View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim D.[_2_] Jim D.[_2_] is offline
external usenet poster
 
Posts: 16
Default Can you use worksheet names in macros

Hi Lyn,
This bit of code below should help you, I think. It adds a new sheet at the
end of the workbook, and renames it to whatever you want using an algorithm
or some type, or any constant name (in this case, the newly created sheet
name is "temp"). Hope that helps.

Set NewSheet = Worksheets.Add
NewSheet.Name = "Temp"
NewSheet.Move After:=Sheets(Sheets.Count)

"Lyn" wrote:

I'm just learning to utilise macros and VB in excel and I am having trouble
with the following:

Sheet 1 is called "WE 01-01-01"
I wish to automate the process of inserting a new worksheet and renaming it
"WE 08-01-01" and so on each week. Using a simple macro the insertion
process is easy but the renaming part I'm having trouble with. Can anyone
help