Cells.Select - Why not in a module?
"Greg Wilson" wrote in
message ...
You cannot select cells in other than the active sheet.
You must first select the sheet before selecting the
cells. For example, this works:
Sub SelAll()
Dim Sht As Worksheet
For Each Sht In ActiveWorkbook.Worksheets
Sht.Select
Sht.Cells.Select
Next
End Sub
Your second code example works because it references the
active sheet. The cells method, when not qualified,
refers to the active sheet; i.e. the
statement "Cells.Select" by default refers to the cells of
the active sheet.
Thanks Greg,
Much appreciated.
Regards,
Alan.
|