Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How to detect current active sheet number

Hi guys

When prohramming, I want to know the sheet number, how could I get it

Thanks

Mike
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default How to detect current active sheet number

ActiveSheet.Index will give you the sheet's number, regardless of its name

But if you're looking for something like "Sheet1" then you'd be better
off withActiveSheet.Name

Mike Chen wrote:
Hi guys,

When prohramming, I want to know the sheet number, how could I get it?

Thanks,

Mike


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 968
Default How to detect current active sheet number

Hi Mike,

depends what you mean by sheet number:

Dim j as long
for j=1 to Worksheets.count
msgbox "sheet number " & j & " is named " & worksheets(j).name
next j

this shows you the sequence number in the worksheets collection: is that
what you are looking for?


regards
Charles
______________________
Decision Models
FastExcel Version 2 now available.
www.DecisionModels.com/FxlV2WhatsNew.htm

"Mike Chen" wrote in message
...
Hi guys,

When prohramming, I want to know the sheet number, how could I get it?

Thanks,

Mike



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How to detect current active sheet number

Hi Steve

Thanks, It is just what I want!
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
How to add todays date (static) to the current active cell using m JimmyJam75 Excel Discussion (Misc queries) 5 September 6th 06 11:23 AM
Populate current active cell - Help Please!! Larry Excel Worksheet Functions 0 July 19th 06 10:19 PM
Identify current active cell reades Excel Worksheet Functions 6 January 10th 06 12:48 PM
Return number of current sheet Brandon Excel Worksheet Functions 3 April 26th 05 05:55 AM
Detect when Active Cell Changes GarethG[_8_] Excel Programming 1 October 22nd 03 02:16 PM


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

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

About Us

"It's about Microsoft Excel"