I have a word (2013) document and I want to move the five characters that follow gtg to the beginning of the line. I have recorded a macro by clicking “find” which gives the navigation input box and I type “gtg, enter” this highlights gtg and then I close the Navigation box by clicking the “X”. I than do arrow right, “shift key+ arrow right 5 times. click copy. home, paste, space key, arrow down, home. The five characters are at the front of the first line and the cursor is now positioned at the front of the next line. This is what I want the macro to do but it does not record the clicks and key stroke for the “find” part. Following is the edit of the macro.
Sub Macro3()
‘
‘ Macro3 Macro
‘
‘
CommandBars(“Navigation”).Visible = False
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=5, Extend:=wdExtend
Selection.Copy
Selection.HomeKey Unit:=wdLine
Selection.PasteAndFormat (wdFormatOriginalFormatting)
Selection.TypeText Text:=” ”
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.HomeKey Unit:=wdLine
End Sub
can some one give me VBA instructions that I can use to search for “gtg”? Also I would like to have this repeat to the end of the document.
This is the first few lines of the document:
a sower came from ancient hills (gtg 171).sbsong
all with joyful exultation (gtg 798).sbsong
amazing grace,how sweet the sound (gtg649).sbsong
an upper room did our lord prepare (gtg 202).sbsong
away in a manger (gtg 115) (ik).sbsong
before the marvel of this night (gtg 125).sbsong
Thanks