error - select method failed - (columns.select)
Hi P,
Your error is encountered because you
cannot make selections on an inactive
sheet.
Try the following version:
'===========
Sub unhide()
Dim sh As Worksheet
For Each sh In ActiveWorkbook.Worksheets
sh.Columns.Hidden = False
Next sh
End Sub
'<<===========
---
Regards.
Norman
"PBcorn" wrote in message
...
Getting a 1004 error - select method of range class failed - with the
following code:
Sub unhide()
Dim sh As Object
For Each sh In ActiveWorkbook.Worksheets
sh.Visible = True
sh.Columns.Select
Selection.EntireColumn.Hidden = False
Next sh
End Sub
the code is in a module. The macro works for the first sheet of the
three-sheet workbook then bombs on the second sheet
Thanks in advance
PB
|