View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Alan Alan is offline
external usenet poster
 
Posts: 188
Default Cells.Select - Why not in a module?


Hi All,

Can anyone explain why the following code does not work in a module:


Sub SelAll()

For Each Sht In ActiveWorkbook.Worksheets

Sht.Cells.Select

Next

End Sub



Whereas, the following code works fine in a worksheet code:

Sub SelSht()

Cells.Select

End Sub


I am guessing it is related to scope, but I cannot see why from my
reading of the excel help files.

Thanks in advance,

Alan.