C
Cheryl
I recorded a short macro in MicrosoftWord 2003 for a repetive task, then
tried to modify it in the macro editor when conditions changed. This is the
macro:
Sub Macro2()
'
' Macro2 Macro
' Macro recorded 8/9/2005 by Administrator
'
Selection.Font.Size = 12
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCell
Selection.TypeText Text:="CSW"
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCell, Count:=4
Selection.SelectCell
Selection.Copy
Selection.MoveLeft Unit:=wdCell, Count:=4
Selection.PasteAndFormat (wdPasteDefault)
Selection.MoveLeft Unit:=wdCell
Selection.MoveLeft Unit:=wdCell
End Sub
The part that doesn't work starts at the line "Selection.SelectCell". I
want to copy the contents of the current cell of the table, then paste them
to the cell that I move to. I'm pretty sure that all my moves are correct
because the cursor ends up in the cell I expect it to, but when the macro
finishes, the contents of the cell I tried to copy haven't been pasted to the
cell I expected it to be pasted into. What exactly does "SelectCell" do? Is
there some other way I should be doing this?
Thank you.
Cheryl
tried to modify it in the macro editor when conditions changed. This is the
macro:
Sub Macro2()
'
' Macro2 Macro
' Macro recorded 8/9/2005 by Administrator
'
Selection.Font.Size = 12
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCell
Selection.TypeText Text:="CSW"
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCell, Count:=4
Selection.SelectCell
Selection.Copy
Selection.MoveLeft Unit:=wdCell, Count:=4
Selection.PasteAndFormat (wdPasteDefault)
Selection.MoveLeft Unit:=wdCell
Selection.MoveLeft Unit:=wdCell
End Sub
The part that doesn't work starts at the line "Selection.SelectCell". I
want to copy the contents of the current cell of the table, then paste them
to the cell that I move to. I'm pretty sure that all my moves are correct
because the cursor ends up in the cell I expect it to, but when the macro
finishes, the contents of the cell I tried to copy haven't been pasted to the
cell I expected it to be pasted into. What exactly does "SelectCell" do? Is
there some other way I should be doing this?
Thank you.
Cheryl