View Single Post
 
Old 02-16-2015, 03:51 PM
Guessed's Avatar
Guessed Guessed is offline Windows 7 32bit Office 2010 32bit
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

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
Reply With Quote