Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-25-2011, 08:07 PM
cegbuna cegbuna is offline Formatting Windows Vista Formatting Office 2007
Novice
Formatting
 
Join Date: Mar 2011
Posts: 4
cegbuna is on a distinguished road
Default Formatting

This is a random question but I thought i asked anyway. I need to organize data in a specified form before I can feed it into an external program to pull information from a database.

Here is the desired format.

('1234','1234','1234'.... etc).

I am importing numerous Data from excel into word in a tabulated form and cant type each and every text in the format above.



1234
1234
1234
1234

Is there a way to convert the tabulated data format into the desired form above?

Thanks.
Reply With Quote
  #2  
Old 03-26-2011, 07:36 PM
macropod's Avatar
macropod macropod is offline Formatting Windows 7 32bit Formatting Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi cegbuna,

For the data you've indicated, a wildcard Find/Replace should do the job, with:
Find = (')([0-9A-Za-z]{1,})([',]{1,2})
Replace = \2^p

The above will find any alphanumeric string preceded by a single quote and succeeded by a single quote and/or a comma, and delete everything except the alphanumeric string, which it then succeeds with a paragraph break. No vba required.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 03-26-2011, 08:08 PM
cegbuna cegbuna is offline Formatting Windows Vista Formatting Office 2007
Novice
Formatting
 
Join Date: Mar 2011
Posts: 4
cegbuna is on a distinguished road
Default

How and where do I enter that code?

I am trying to convert the tabulated data into the ('****','****',...etc) format.

Thanks
Reply With Quote
  #4  
Old 03-26-2011, 08:16 PM
macropod's Avatar
macropod macropod is offline Formatting Windows 7 32bit Formatting Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by cegbuna View Post
How and where do I enter that code?
Well, since it's for a Find/Replace, you should enter it into Word's Find/Replace dialogue box ... (and do remember to choose the wildcards option)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 03-26-2011, 09:26 PM
cegbuna cegbuna is offline Formatting Windows Vista Formatting Office 2007
Novice
Formatting
 
Join Date: Mar 2011
Posts: 4
cegbuna is on a distinguished road
Default

I tried the code and it didn't work.

Thanks for the response.
Reply With Quote
  #6  
Old 03-26-2011, 10:10 PM
macropod's Avatar
macropod macropod is offline Formatting Windows 7 32bit Formatting Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi cegbuna,

Apologies - the Find/Replace expression I posted is for the reverse of what you're after. Try the following wildcard Find/Replace:
Find = ([!^13]{1,})^13
Replace = ^39\1^39,

After running this, you'll have an extra comma at the end of the data, which you can delete manually.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 03-27-2011, 07:30 AM
cegbuna cegbuna is offline Formatting Windows Vista Formatting Office 2007
Novice
Formatting
 
Join Date: Mar 2011
Posts: 4
cegbuna is on a distinguished road
Default

It worked! Thank you.
Reply With Quote
  #8  
Old 03-27-2011, 02:20 PM
macropod's Avatar
macropod macropod is offline Formatting Windows 7 32bit Formatting Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You're welcome - and now you have the Find/Replace code for going in either direction!
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Formatting macro Ulodesk Word Tables 9 04-10-2012 06:37 PM
Automatic Formatting for whole row Bacchanal Promotions Excel 2 03-19-2011 05:12 AM
Formatting I want to remove formatting Rose Word 2 05-30-2010 04:12 AM
numbering and formatting whitemelly Word 0 02-11-2010 09:06 AM
Formatting Formatting Help caution5697 Word 3 04-22-2009 11:53 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:30 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft