View Single Post
 
Old 02-15-2015, 05:23 AM
bracketandquotes bracketandquotes is offline Windows 8 Office 2010 32bit
Novice
 
Join Date: Feb 2015
Posts: 8
bracketandquotes is on a distinguished road
Default macro to add brackets to each line and add single quotes to each word in the line

Hello
Im looking for a macro that add brackets to the beginning and end of each line and adds single quotes to each word in the line and add a comma at the end of the line.

the reason is I am writing code in Sql and need to prepare some of it first in word.

Line example
AFG FKFKF DDJ DKKFJG DKDKJDJF

I want the line above to look like this after the macro is run
('AFG', 'FKFKF', 'DDJ', 'DKKFJG', 'DKDKJDJF'),

I would like the macro to work on all the lines in the word dcoument.

thanks for any help offered.
Reply With Quote