Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default 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
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
Creating 2 new Worksheets Nycki Excel Discussion (Misc queries) 15 July 18th 09 01:30 AM
Creating new worksheets Funkyfido Excel Worksheet Functions 1 April 27th 09 04:45 PM
creating sub worksheets Manny M Excel Worksheet Functions 1 May 9th 08 11:14 PM
Creating worksheets [email protected] New Users to Excel 1 January 7th 08 01:15 PM
Creating old xls worksheets. Mattias Excel Discussion (Misc queries) 2 April 18th 07 11:50 AM


All times are GMT +1. The time now is 02:54 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"