ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how to dynamically get sheet name (https://www.excelbanter.com/excel-programming/415189-how-dynamically-get-sheet-name.html)

LetMeDoIt

how to dynamically get sheet name
 
Greetings,

I'm trying dynamically store into a variable the name of the active
sheet. I've tried various combination (based on my less than expert
experience with VBA code).

Any light shed would be greatly appreciated.

regards,
CG

Mike H

how to dynamically get sheet name
 
Maybe

MyName = ActiveSheet.Name

Mike

"LetMeDoIt" wrote:

Greetings,

I'm trying dynamically store into a variable the name of the active
sheet. I've tried various combination (based on my less than expert
experience with VBA code).

Any light shed would be greatly appreciated.

regards,
CG


LetMeDoIt

how to dynamically get sheet name
 
thank you. that was simple.

regards, CG

Mike H

how to dynamically get sheet name
 
Glad I could help

"LetMeDoIt" wrote:

thank you. that was simple.

regards, CG


Barb Reinhardt

how to dynamically get sheet name
 
I've done this (and not used the name)
Dim aWS as Excel.worksheet

Set aWS = ActiveSheet

Anywhere you've use Activesheet, replace with aWS.

aWS.cells(1,1).value = ...
aws.range("myRange").address
aWS.name
aWS.Parent.Name <~~workbook name

--
HTH,
Barb Reinhardt



"LetMeDoIt" wrote:

Greetings,

I'm trying dynamically store into a variable the name of the active
sheet. I've tried various combination (based on my less than expert
experience with VBA code).

Any light shed would be greatly appreciated.

regards,
CG



All times are GMT +1. The time now is 02:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com