Hello all. I had recorded a macro for my use in the current project I am on. When I turned on macro recording, I assigned the macro a short cut key combination like I usually do. Ok fine. Then when I went to use the macro I just recorded, it threw an error and when I looked at the code, it was missing the Sub <> () line at the top of the procedure. I have had this problem a few times before and historically, if I try to fix the code, word will crash on me. I had thought this problem was related to having a lot of macros in my NewMacros folder (more than 60 or so) more macros in it, (post 5, http://www.vbaexpress.com/forum/showthread.php?t=41786), but it doesn't since I only have 5 macros in this folder now. Any suggestions?
The code is below and a picture of the code window with the arrow showing the line the error is attached.
[vba]Sub Macro3()
'
' Macro3 Macro
'
'
Selection.MoveDown Unit:=wdLine, Count:=2, Extend:=wdExtend
Options.DefaultHighlightColorIndex = wdYellow
Selection.Range.HighlightColorIndex = wdYellow
Selection.MoveDown Unit:=wdLine, Count:=1
Options.DefaultHighlightColorIndex
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Application.Run MacroName:="Normal.HighlighterAppVer1.EditCopy"
End Sub
'
' Macro4 Macro
'
'
Selection.EndKey Unit:=wdStory
Selection.TypeParagraph
Selection.Paste
Selection.MoveUp Unit:=wdLine, Count:=1
Selection.Rows.ConvertToText Separator:=wdSeparateByCommas, NestedTables:= _
True
Selection.WholeStory
Application.Run MacroName:="Normal.HighlighterAppVer1.EditCopy"
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "14.3.10.7.1.1"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
End Sub
[/vba]