Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
gjmink
 
Posts: n/a
Default Advice needed - counting tabs

This worked great the last time I had a question, so I'd thought we to would
try again. Is there a function available that would count the number of tabs
in a spreadsheet that has many many tabs. Thanks for your help!!
--
Have a great day and a better tomorrow!
  #2   Report Post  
Ken Wright
 
Posts: n/a
Default

Put it in a module and call it with =NumShts()

Function NumShts()
NumShts = ActiveWorkbook.Sheets.Count
End Function

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------



"gjmink" wrote in message
...
This worked great the last time I had a question, so I'd thought we to would
try again. Is there a function available that would count the number of tabs
in a spreadsheet that has many many tabs. Thanks for your help!!
--
Have a great day and a better tomorrow!



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.802 / Virus Database: 545 - Release Date: 26/11/2004


  #3   Report Post  
Sandy Mann
 
Posts: n/a
Default

Ken,

(as you know), it won't recalculate unless you add an

Application.Volatile

line. The odd thing is that although it doesn't recalculate without the
added line on a sheet recalculate or when a sheet is added, it does
when a sheet is deleted ( in XL97.)

Is it the same in other versions and do you know why that would be?

Regards

Sandy

--
to e-mail direct replace @mailintor.com with @tiscali.co.uk


"Ken Wright" wrote in message
...
Put it in a module and call it with =NumShts()

Function NumShts()
NumShts = ActiveWorkbook.Sheets.Count
End Function

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

--------------------------------------------------------------------------

--
It's easier to beg forgiveness than ask permission :-)
--------------------------------------------------------------------------

--



"gjmink" wrote in message
...
This worked great the last time I had a question, so I'd thought we to

would
try again. Is there a function available that would count the number of

tabs
in a spreadsheet that has many many tabs. Thanks for your help!!
--
Have a great day and a better tomorrow!



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.802 / Virus Database: 545 - Release Date: 26/11/2004







  #4   Report Post  
Ken Wright
 
Posts: n/a
Default

Hi Sandy - my bad, should have included it, and should probably also have used
ThisWorkbook as opposed to ActiveWorkbook. Works the same in all versions up to
2003 I believe (or seems to), and no I have no idea why it fires for one and not
the other. When you say 'a sheet is added' though, I assume you mean via
'Insert New Worksheet', because obviously you can add sheets by copying or
moving etc, and when done via this route it does trigger it.

Either way though, just as easy to get round that particular issue by using the
Workbook_NewSheet in the TW module to trigger a calculation.

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------


<snip


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.803 / Virus Database: 546 - Release Date: 30/11/2004


  #5   Report Post  
Sandy Mann
 
Posts: n/a
Default

Thank you Ken,

the other. When you say 'a sheet is added' though, I assume you mean via
'Insert New Worksheet', because obviously you can add sheets by copying or
moving etc, and when done via this route it does trigger it.


curiouser and curiouser

Sandy

--
to e-mail direct replace @mailintor.com with @tiscali.co.uk


"Ken Wright" wrote in message
...
Hi Sandy - my bad, should have included it, and should probably also have

used
ThisWorkbook as opposed to ActiveWorkbook. Works the same in all versions

up to
2003 I believe (or seems to), and no I have no idea why it fires for one

and not
the other. When you say 'a sheet is added' though, I assume you mean via
'Insert New Worksheet', because obviously you can add sheets by copying or
moving etc, and when done via this route it does trigger it.

Either way though, just as easy to get round that particular issue by

using the
Workbook_NewSheet in the TW module to trigger a calculation.

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

--------------------------------------------------------------------------

--
It's easier to beg forgiveness than ask permission :-)
--------------------------------------------------------------------------

--


<snip


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.803 / Virus Database: 546 - Release Date: 30/11/2004





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
Worksheet Tabs TheJaxSun Excel Discussion (Misc queries) 5 December 4th 05 03:37 AM
building invoice - strategy advice Excel Discussion (Misc queries) 0 January 3rd 05 01:29 PM
Hidding Tabs Aviator Excel Discussion (Misc queries) 1 December 15th 04 04:55 PM
Sheet tabs disappear sometimes in Internet Explorer Jan Nordgreen Excel Discussion (Misc queries) 0 December 6th 04 01:34 AM
Tabs on Excel 2000 Fred Zuban Excel Worksheet Functions 4 November 5th 04 07:17 PM


All times are GMT +1. The time now is 11:03 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"