D
davegb
This simple macro hides certain columns, then it's supposed to select
cell B3, but it tells me the select methods failed.
Sub HideColTop2AC()
Dim rTopCell As Range
Dim lColTop As Long
Dim WkSht As Worksheet
For Each WkSht In ActiveWorkbook.Worksheets
If Not Right(WkSht.Name, 7) = "Records" Then
Set rTopCell = WkSht.Range("3:3").find("top",
LookIn:=xlValues, LookAt:=xlPart)
If Not rTopCell Is Nothing Then
lColTop = rTopCell.Column
WkSht.Range(WkSht.Columns(lColTop),
WkSht.Columns("AC")).Hidden = True
WkSht.Range("B3").Select<---ERROR
End If
End If
Next
End Sub
Why is the select failing?
Thanks
cell B3, but it tells me the select methods failed.
Sub HideColTop2AC()
Dim rTopCell As Range
Dim lColTop As Long
Dim WkSht As Worksheet
For Each WkSht In ActiveWorkbook.Worksheets
If Not Right(WkSht.Name, 7) = "Records" Then
Set rTopCell = WkSht.Range("3:3").find("top",
LookIn:=xlValues, LookAt:=xlPart)
If Not rTopCell Is Nothing Then
lColTop = rTopCell.Column
WkSht.Range(WkSht.Columns(lColTop),
WkSht.Columns("AC")).Hidden = True
WkSht.Range("B3").Select<---ERROR
End If
End If
Next
End Sub
Why is the select failing?
Thanks