ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Setting variable = to sheet name (https://www.excelbanter.com/excel-programming/305068-setting-variable-%3D-sheet-name.html)

Jeff Armstrong

Setting variable = to sheet name
 
I have a simple question. What is the code to set a
variable to the name of the activesheet in Excel?\

Dim SheetName As String

SheetName = <code?

Jeff

Michael Tomasura[_2_]

Setting variable = to sheet name
 
Try this

SheetName = ActiveSheet.Name

Michael Tomasura
"Jeff Armstrong" wrote in message
...
I have a simple question. What is the code to set a
variable to the name of the activesheet in Excel?\

Dim SheetName As String

SheetName = <code?

Jeff




Frank Kabel

Setting variable = to sheet name
 
Hi
SheetName = activesheet.name

--
Regards
Frank Kabel
Frankfurt, Germany


Jeff Armstrong wrote:
I have a simple question. What is the code to set a
variable to the name of the activesheet in Excel?\

Dim SheetName As String

SheetName = <code?

Jeff



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

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