Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA- Counting the number of the sheets

Hi,

I’m trying to write a macro which could count the number of the sheet
in the workbook. I need this for a condition in my do-loop circle. Th
number of the sheets is variable.

If somebody could help me and tell me a way to do this I would be ver
pleased.


Thanks,

-Tims

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA- Counting the number of the sheets

Timse,

these two should do the job:

Activeworkbook.Sheets.Count

OR

Workbooks("name").Sheets.Count

Good luc

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default VBA- Counting the number of the sheets

Timse,

Worksheets.Count will return the number.

HTH,
Nikos

"Timse " wrote in message
...
Hi,

I’m trying to write a macro which could count the number of the sheets
in the workbook. I need this for a condition in my do-loop circle. The
number of the sheets is variable.

If somebody could help me and tell me a way to do this I would be very
pleased.


Thanks,

-Timse


---
Message posted from http://www.ExcelForum.com/



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 599
Default VBA- Counting the number of the sheets

Timse

ActiveWorkbook.Sheets.Count

will count all the sheets (worksheets, charts, etc.)

ActiveWorkbook.Worksheets.Count

just the worksheets.

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com

"Timse " wrote in message
...
Hi,

I'm trying to write a macro which could count the number of the sheets
in the workbook. I need this for a condition in my do-loop circle. The
number of the sheets is variable.

If somebody could help me and tell me a way to do this I would be very
pleased.


Thanks,

-Timse


---
Message posted from http://www.ExcelForum.com/



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA- Counting the number of the sheets

Thank you all!

This really helped me!

-Tims

--
Message posted from http://www.ExcelForum.com

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting number of cells that match name AND number Ronster[_2_] Excel Worksheet Functions 4 August 18th 08 12:03 PM
Counting Occurances across a range of sheets [email protected] Excel Discussion (Misc queries) 8 April 3rd 07 02:51 PM
counting duplicates Among Many Sheets, Possible?? Mhz New Users to Excel 5 July 5th 06 02:23 AM
Counting occurrences over range of sheets DailyRich Excel Worksheet Functions 3 January 9th 06 10:49 PM
Loop across Sheets and number of sheets Raj[_8_] Excel Programming 2 December 18th 03 09:18 AM


All times are GMT +1. The time now is 11:02 PM.

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"