Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 309
Default Get name of active sheet

I have one sheet in my workbook named "Work Data".
If this sheet is active, then the following expression

Application.ActiveSheet.Name

.... will return a string of "Work Data". However, I don't
want the name of the string in the sheet tab, I want the name from
my VBA project window (named Sheet1). How can I retrieve
the VBA name of my sheet??

thank u

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Get name of active sheet

Application.ActiveSheet.CodeName

Be aware though that newly added sheets since the workbook was opened while
the VBE is closed will not have a codeName. There are various workarounds to
force one, search this ng.

Regards,
Peter T

"Robert Crandal" wrote in message
...
I have one sheet in my workbook named "Work Data".
If this sheet is active, then the following expression

Application.ActiveSheet.Name

... will return a string of "Work Data". However, I don't
want the name of the string in the sheet tab, I want the name from
my VBA project window (named Sheet1). How can I retrieve
the VBA name of my sheet??

thank u



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Get name of active sheet

Hi,

MsgBox ActiveSheet.CodeName

Mike

"Robert Crandal" wrote:

I have one sheet in my workbook named "Work Data".
If this sheet is active, then the following expression

Application.ActiveSheet.Name

.... will return a string of "Work Data". However, I don't
want the name of the string in the sheet tab, I want the name from
my VBA project window (named Sheet1). How can I retrieve
the VBA name of my sheet??

thank u

.

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
Send Data From Active Sheet to Closed Sheet on Network ryguy7272 Excel Programming 4 July 3rd 08 08:44 PM
active sheet is 'slow' to be active Charlie Excel Programming 1 December 31st 07 06:33 AM
I need to sort an active sheet using the col of the active cell HamFlyer Excel Programming 3 June 6th 06 07:25 PM
Copy my active sheet to a new sheet and open with an input form Brad Withrow Excel Programming 0 April 6th 06 03:56 AM
Copy from active sheet and paste into new sheet using info from cell in active Ingve Excel Programming 3 January 23rd 06 09:57 PM


All times are GMT +1. The time now is 09:27 AM.

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"