Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
MB
 
Posts: n/a
Default Name and number of sheets

Could someone please post the code that will count the
number of sheets in a workbook and get each sheet name. I
thought I could use the for statement after I got the
number of sheets, but can't seem to get that number.

Thank you
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

Maybe something like:

Option Explicit
Sub testme()

Dim wks As Worksheet

MsgBox Sheets.Count
MsgBox Worksheets.Count

For Each wks In ActiveWorkbook.Worksheets
MsgBox wks.Name
Next wks
End Sub

Worksheets.count may not equal sheets.count (if you have chart sheets for
example).

MB wrote:

Could someone please post the code that will count the
number of sheets in a workbook and get each sheet name. I
thought I could use the for statement after I got the
number of sheets, but can't seem to get that number.

Thank you


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:53 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"