I need to loop a simple macro. I was successful using "Chain" for years until everything changed I reckon. I know squat about vb.
I have many similar lines. I recorded a macro that edits the line of text and drops to the beginning of the next line.
Now i want that to repeat until the end of the doc.
I believe it is the Loop. I searched a read many articles but it isn't clear to me. Should be easy I think.
the name of the macro is csv and is below. I have tried the Loop, Do Loop. The debug doesn't help, nor the help when i get the syntax error.
Anyone that will help I appreciate it.
Sub csv()
'
' csv Macro
'
'
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdWord, Count:=1
Selection.TypeText Text:=","
Selection.MoveRight Unit:=wdWord, Count:=3
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=1
End Sub
I have many similar lines. I recorded a macro that edits the line of text and drops to the beginning of the next line.
Now i want that to repeat until the end of the doc.
I believe it is the Loop. I searched a read many articles but it isn't clear to me. Should be easy I think.
the name of the macro is csv and is below. I have tried the Loop, Do Loop. The debug doesn't help, nor the help when i get the syntax error.
Anyone that will help I appreciate it.
Sub csv()
'
' csv Macro
'
'
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdWord, Count:=1
Selection.TypeText Text:=","
Selection.MoveRight Unit:=wdWord, Count:=3
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=1
End Sub