C
chrisnsmith
I use this macro I recorded to clear O from my worksheet. If there are no O's
I get an error in the VB debugger. What do I need to add to tell it to do
nothing if there are no O's.?
Sheets("Reg Positions").Select
Range("A6:E700").Select
Selection.sort Key1:=Range("A6"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Cells.Find(What:="O", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False).Activate
Cells.Replace What:="O", Replacement:="", LookAt:=xlPart, SearchOrder:= _
xlByRows, MatchCase:=False
I get an error in the VB debugger. What do I need to add to tell it to do
nothing if there are no O's.?
Sheets("Reg Positions").Select
Range("A6:E700").Select
Selection.sort Key1:=Range("A6"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Cells.Find(What:="O", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False).Activate
Cells.Replace What:="O", Replacement:="", LookAt:=xlPart, SearchOrder:= _
xlByRows, MatchCase:=False