G
greggorio
Hello,
I need to process a large table with a repeatable action. I have
recorded a macro and it works fine. The problem is, I need to make the
macro repeat itself until it reaches the end of the document. How to do
it?
The macro is:
----------------------------------
Sub kontr1()
'
' kontr1 Macro
' Macro recorded 2006-09-01 by greg
'
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Copy
Selection.MoveLeft Unit:=wdCell
Selection.MoveLeft Unit:=wdCell
Selection.MoveLeft Unit:=wdCell
Selection.PasteAndFormat (wdPasteDefault)
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCell
Selection.Copy
Selection.MoveLeft Unit:=wdCell
Selection.MoveLeft Unit:=wdCell
Selection.MoveLeft Unit:=wdCell
Selection.MoveLeft Unit:=wdCell
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.TypeText Text:="-"
Selection.PasteAndFormat (wdPasteDefault)
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveDown Unit:=wdLine, Count:=1
End Sub
I need to process a large table with a repeatable action. I have
recorded a macro and it works fine. The problem is, I need to make the
macro repeat itself until it reaches the end of the document. How to do
it?
The macro is:
----------------------------------
Sub kontr1()
'
' kontr1 Macro
' Macro recorded 2006-09-01 by greg
'
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Copy
Selection.MoveLeft Unit:=wdCell
Selection.MoveLeft Unit:=wdCell
Selection.MoveLeft Unit:=wdCell
Selection.PasteAndFormat (wdPasteDefault)
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCell
Selection.Copy
Selection.MoveLeft Unit:=wdCell
Selection.MoveLeft Unit:=wdCell
Selection.MoveLeft Unit:=wdCell
Selection.MoveLeft Unit:=wdCell
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.TypeText Text:="-"
Selection.PasteAndFormat (wdPasteDefault)
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveDown Unit:=wdLine, Count:=1
End Sub