Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
error handling - dodgy syntax
Hi Helen,
Yeah the resume would resume at the line that created the error which you have already cleared. Change your error handling to: ChangeNotNecessary: If Err.Number = 1004 Then Resume Nextx else Msgbox Err.number & " " & Err.Description End If Nextx: Next x Any problems then post back, James Helen wrote: I've created the following code, but it will only run once before sticking, I've included Resume, but I'm not sure I've put it in the right place. After the error has been identified I want the macro to move on to Next X. For x = 4 To myRows NewFormat = Range("G" & x) On Error GoTo ChangeNotNecessary If WorksheetFunction.Search(",", NewFormat, 1) + 2 = Len(NewFormat) Then Range("G" & x).Select Selection.Replace What:=".", Replacement:="", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False Selection.Replace What:=",", Replacement:=".", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False Selection.Style = "Comma" End If ChangeNotNecessary: If Err.Number = 1004 Then Err.Clear End If On Error GoTo 0 Resume Next x |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
UDF Error Handling is ignored. Not for everyone? | Excel Programming | |||
Error Handling - On Error GoTo doesn't trap error successfully | Excel Programming | |||
Error handling with a handling routine | Excel Programming | |||
error handling | Excel Programming | |||
Error Handling | Excel Programming |