Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What is the code to insert a sheet and name it when it is
insert. This is what I have, but it won't work if there already is a sheet4. Sheets.Add Sheets("Sheet4").Select Sheets("Sheet4").Name = "Worksheet" Thank you |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Worksheets.Add.Name = "Bob" -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) wrote in message ... What is the code to insert a sheet and name it when it is insert. This is what I have, but it won't work if there already is a sheet4. Sheets.Add Sheets("Sheet4").Select Sheets("Sheet4").Name = "Worksheet" Thank you |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this
Sub test() On Error Resume Next Sheets.Add.Name = "Worksheet" If Err.Number 0 Then MsgBox "Change the name of : " & ActiveSheet.Name & " manually" Err.Clear End If On Error GoTo 0 End Sub -- Regards Ron de Bruin http://www.rondebruin.nl wrote in message ... What is the code to insert a sheet and name it when it is insert. This is what I have, but it won't work if there already is a sheet4. Sheets.Add Sheets("Sheet4").Select Sheets("Sheet4").Name = "Worksheet" Thank you |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
insert sheet tab is not functioning and can't add new sheet | Excel Worksheet Functions | |||
Insert Sheet | Excel Worksheet Functions | |||
Can not insert sheet??? | Excel Worksheet Functions | |||
insert query into excell sheet to update excell sheet and pivot table | Excel Discussion (Misc queries) | |||
Inserting a row in sheet A should Insert a row in sheet B, removing a row in Sheet A should remove the corresponding row in sheet B | Excel Programming |