Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Putting woirksheet name into a variable
I have a form where a new sheet is created in a workbook. Everytime a sheet
is created it incraments up (sheet1, sheet2, sheet3, sheet4). I was tring to put the active sheet name into a varable but I do not know the syntax. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Putting woirksheet name into a variable
try this:-
Sub filefile() With ThisWorkbook .Sheets.Add After:=.Sheets(.Sheets.Count) End With myName = ActiveSheet.Name msgbox myName End Sub "BZeyger" wrote: I have a form where a new sheet is created in a workbook. Everytime a sheet is created it incraments up (sheet1, sheet2, sheet3, sheet4). I was tring to put the active sheet name into a varable but I do not know the syntax. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Putting woirksheet name into a variable
On 17 Apr, 17:38, BZeyger wrote:
I have a form where a new sheet is created in a workbook. Everytime a sheet is created it incraments up (sheet1, sheet2, sheet3, sheet4). I was tring to put the active sheet name into a varable but I do not know the syntax. Dim sWshName as string sWshName=activeworkbook.worksheets(activeworkbook. worksheets.count).name should do the job |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Putting woirksheet name into a variable
Option Explicit
Sub zeyger() Dim ws As Worksheet Dim sName As String sName = "Zeyger" Worksheets.Add ActiveSheet.Name = sName End Sub hth! susan On Apr 17, 12:38 pm, BZeyger wrote: I have a form where a new sheet is created in a workbook. Everytime a sheet is created it incraments up (sheet1, sheet2, sheet3, sheet4). I was tring to put the active sheet name into a varable but I do not know the syntax. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
putting a name in the name box | Excel Discussion (Misc queries) | |||
Putting macros together | Excel Discussion (Misc queries) | |||
Putting | Excel Programming | |||
Putting a search box | Excel Programming | |||
Putting text in a column based on variable text from another colum | Excel Discussion (Misc queries) |