Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How do I add a new worksheet and give it a name by using
code, the name will be entered in cell A1 of sheet 1. I want a button that I can click that will automatically create the Worksheet at the end of the book with the name in cell A1 THanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
worksheets.Add(After:=Worksheets(worksheets.count) ).Name = _
Worksheets("sheet1").Range("A1") -- Regards, Tom Ogilvy "Jaina Williams" wrote in message ... How do I add a new worksheet and give it a name by using code, the name will be entered in cell A1 of sheet 1. I want a button that I can click that will automatically create the Worksheet at the end of the book with the name in cell A1 THanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
THat worked so I tried some modifications to test
something, this is what I did Sheets("sheet2").Copy(After:=Worksheets_ (Worksheets.Count)).Name = Worksheets("sheet1").Range("A1") It tells me Object is required -----Original Message----- worksheets.Add(After:=Worksheets(worksheets.count )).Name = _ Worksheets("sheet1").Range("A1") -- Regards, Tom Ogilvy "Jaina Williams" wrote in message ... How do I add a new worksheet and give it a name by using code, the name will be entered in cell A1 of sheet 1. I want a button that I can click that will automatically create the Worksheet at the end of the book with the name in cell A1 THanks . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Adding a worksheet returns a reference to that sheet. Copying a worksheet
does not. Thus your problem. Use this: Sheets("sheet2").Copy After:=Worksheets _ (Worksheets.Count) ActiveSheet.Name = Worksheets("sheet1").Range("A1") -- Regards, Tom Ogilvy "Jaina Williams" wrote in message ... THat worked so I tried some modifications to test something, this is what I did Sheets("sheet2").Copy(After:=Worksheets_ (Worksheets.Count)).Name = Worksheets("sheet1").Range("A1") It tells me Object is required -----Original Message----- worksheets.Add(After:=Worksheets(worksheets.count )).Name = _ Worksheets("sheet1").Range("A1") -- Regards, Tom Ogilvy "Jaina Williams" wrote in message ... How do I add a new worksheet and give it a name by using code, the name will be entered in cell A1 of sheet 1. I want a button that I can click that will automatically create the Worksheet at the end of the book with the name in cell A1 THanks . |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
the code for the button Sheets.Add(, Sheets(Sheets.Count)).Name = "nameyouwant" sheets(1).range("A1")="nameyouwant" regards Jaina Williams a écrit : How do I add a new worksheet and give it a name by using code, the name will be entered in cell A1 of sheet 1. I want a button that I can click that will automatically create the Worksheet at the end of the book with the name in cell A1 THanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
automatically appending newly added data on worksheet to a master list worksheet | Links and Linking in Excel | |||
plot graph from multiple worksheet as embedded chart object on every worksheet | Charts and Charting in Excel | |||
plot graph from multiple worksheet as embedded chart object on every worksheet | New Users to Excel | |||
Upload multiple text files into 1 excel worksheet + put the filename as the first column in the worksheet | Excel Worksheet Functions | |||
Attaching a JET database to an Excel Worksheet OR storing large binary data in a worksheet | Excel Programming |