satyen
03-30-2010, 04:25 AM
Wasn’t sure whether to start a new thread or not. But because the other one is now resolved, I thought I would.
This is erroring out on
oSh.Cells.Find(What:="Total", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Select
Sub Empty_Sheets()
Dim oSh As Worksheet
For Each oSh In ActiveWorkbook.Worksheets
Select Case oSh.Name
Case "a", "b", "c"
oSh.Cells.EntireRow.Hidden = False
oSh.Cells.Find(What:="Total", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Select
oSh.Selection.EntireColumn.Select
oSh.Range(Selection, Selection.End(xlToLeft)).Select
oSh.Selection.ClearContents
oSh.Range("A1").Select
Debug.Print oSh.Name
End Select
Next oSh
End Sub
This is erroring out on
oSh.Cells.Find(What:="Total", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Select
Sub Empty_Sheets()
Dim oSh As Worksheet
For Each oSh In ActiveWorkbook.Worksheets
Select Case oSh.Name
Case "a", "b", "c"
oSh.Cells.EntireRow.Hidden = False
oSh.Cells.Find(What:="Total", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Select
oSh.Selection.EntireColumn.Select
oSh.Range(Selection, Selection.End(xlToLeft)).Select
oSh.Selection.ClearContents
oSh.Range("A1").Select
Debug.Print oSh.Name
End Select
Next oSh
End Sub