Hi All,
Hope you are all well!
I'm struggling to overcome the error in relation to the below code, would anyone be able to help me out?
Basically I keep getting the 'Run time error 91' for the bolded section of the below code.
In the below I'm searching Column E for the value "4" and if/once it is found to essentially ctrl A and name the region "E".
There won't always be a "4" in Column E and in the current data set I'm using there is no "4" so I have tried to use the error handler 'On Error Go To' to overcome but it doesn't seem to be working...
I'm not sure what I'm doing wrong here.
I appreciate any assistance you could provide.
Many Thanks
David
On Error GoTo Next_G:
Columns("E:E").Select
Selection.Find(What:="4", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
ActiveCell.Select
ActiveCell.CurrentRegion.Select
ActiveWorkbook.Names.Add Name:="E", RefersToR1C1:= _
Selection
ActiveWorkbook.Names("E").Comment = ""
Next_G:
Hope you are all well!
I'm struggling to overcome the error in relation to the below code, would anyone be able to help me out?
Basically I keep getting the 'Run time error 91' for the bolded section of the below code.
In the below I'm searching Column E for the value "4" and if/once it is found to essentially ctrl A and name the region "E".
There won't always be a "4" in Column E and in the current data set I'm using there is no "4" so I have tried to use the error handler 'On Error Go To' to overcome but it doesn't seem to be working...
I'm not sure what I'm doing wrong here.
I appreciate any assistance you could provide.
Many Thanks
David
On Error GoTo Next_G:
Columns("E:E").Select
Selection.Find(What:="4", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
ActiveCell.Select
ActiveCell.CurrentRegion.Select
ActiveWorkbook.Names.Add Name:="E", RefersToR1C1:= _
Selection
ActiveWorkbook.Names("E").Comment = ""
Next_G: