Macros stopping on errors
Posted by Ken on January 28, 2002 10:42 AM
Hi,
I have a number of macros that have worked for years without problems, now they are hanging on undeclared variables "apparently", I did have the "undeclared variables" checkbox checked for a while, but now it is not, it is still hanging on undeclared variables. Any help would be appreciated. Following is an example macro that has worked in the past but is hanging now.
Sub convert()
Application.ScreenUpdating = False
For Each Worksheet In ActiveWorkbook.Worksheets
Worksheet.Select
Range("A9:A100").Select
Selection.Replace What:="+", Replacement:="X", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Range("B9:B100").Select
Selection.Replace What:=".", Replacement:="""", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Selection.Replace What:="+", Replacement:=" ", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
ActiveWindow.LargeScroll Down:=-10
Range("A10").Select
Next Worksheet
Sheets(1).Select
Application.ScreenUpdating = True
ActiveWorkbook.Save
End Sub
Thanks
Ken