![]() |
|
![]() |
|
Thread Tools | Display Modes |
#16
|
|||
|
|||
![]()
It works
![]() Many thanks also to Andrew and Paul for taking the time to do up the codes. You all have been a great help on this David |
#17
|
||||
|
||||
![]()
Your sample document has tabs, not spaces, between the strings. Do you want tabs, or spaces, in the output?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#18
|
||||
|
||||
![]()
And based on your new information of the tab separator, my suggestion would be
Code:
Sub SQLiser() Dim oPara As Paragraph Dim oRng As Range, oParaRng As Range Set oRng = ActiveDocument.Range oRng.Text = Replace(oRng.Text, vbTab, "', '") For Each oPara In oRng.Paragraphs Set oParaRng = oPara.Range oParaRng.MoveEnd Unit:=wdCharacter, Count:=-1 oParaRng.Text = "('" & oParaRng.Text & "')," Next oPara End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Ugeen | Word | 2 | 11-24-2013 03:14 PM |
![]() |
Bobosmite | Word | 5 | 04-15-2013 06:40 AM |
From the command line, how do I run a Word macro? | jdockstader | Word | 7 | 02-04-2013 06:09 AM |
Single Line Spacing for Short Lists? | tatihulot | Word | 2 | 04-20-2010 02:53 PM |
![]() |
George99 | Word | 2 | 01-24-2010 05:49 PM |