Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Creating worksheets then name it
I am attempting to create a new worksheet in a macro and
give it a specified name. I can create the worksheet with the following command: ActiveWorkbook.Sheets.Add After:=Worksheets("test") What I can't figure out is how to name the newly created worksheet. Anyone have an idea on how to do this? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Creating worksheets then name it
John, ActiveSheet.Name = "newsheet" Don Pistulka "john" wrote in message ... I am attempting to create a new worksheet in a macro and give it a specified name. I can create the worksheet with the following command: ActiveWorkbook.Sheets.Add After:=Worksheets("test") What I can't figure out is how to name the newly created worksheet. Anyone have an idea on how to do this? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Creating worksheets then name it
Dim wks As Worksheet
With ActiveWorkbook Set wks = .Sheets.Add(After:=.Sheets("test")) End With wks.Name = "new sheet" "john" wrote in message ... I am attempting to create a new worksheet in a macro and give it a specified name. I can create the worksheet with the following command: ActiveWorkbook.Sheets.Add After:=Worksheets("test") What I can't figure out is how to name the newly created worksheet. Anyone have an idea on how to do this? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Creating worksheets then name it
I don't think the following is shown in the documentation, but I think it
works ok... Sub Demo() Worksheets.Add(Befo=Sheets(1)).Name = "Test" & Sheets.Count End Sub -- Dana DeLouis I am using Windows XP & Office XP = = = = = = = = = = = = = = = = = "john" wrote in message ... I am attempting to create a new worksheet in a macro and give it a specified name. I can create the worksheet with the following command: ActiveWorkbook.Sheets.Add After:=Worksheets("test") What I can't figure out is how to name the newly created worksheet. Anyone have an idea on how to do this? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Creating 2 new Worksheets | Excel Discussion (Misc queries) | |||
Creating new worksheets | Excel Worksheet Functions | |||
creating sub worksheets | Excel Worksheet Functions | |||
Creating worksheets | New Users to Excel | |||
Creating old xls worksheets. | Excel Discussion (Misc queries) |