What different between "sheets" and "worksheets"

  • Thread starter Thread starter hideki
  • Start date Start date
H

hideki

Hi,

I'm new to VBA. Could anybody tell me what is the different between
sheets and worksheets object(?). I wonder when my program didn't work
and when I swift between that two, it became works.

I don't have any code with me now but I think it always happen when I
use to loop like this:

for each ws in Activebook.sheets (or worksheets)

Thanks in advance.
hideki
 
Sheets refers to all sheet types, worksheets, charts, macro sheets, etc.
Worksheets is a specific type of sheet.

If ws was declared as type worksheet, and you have another type of sheet,
you will get a type mismatch error.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Back
Top