Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I want to be able to programmatically insert a new worksheet and then rename this newly added sheet to the contents of an input box. How can I reference the newly added worksheet from code? eg dim sName as string Sheets.Add sName = inputbox("Enter sheet name") Sheets("Sheet4").Select Sheets("Sheet4").Name = sName The only problem with this code, I think, is that the newly created worksheet will not always be called "Sheet4" as it will always increment by 1. Is there a way to count the no. of worksheets in a workbook so that I can have a variable in the code instead of "Sheet4" Thanks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how do i rename a sheet if the rename tab is inactive? | Excel Worksheet Functions | |||
macro to: Add new sheet, then rename new sheet with todays date | Excel Worksheet Functions | |||
Move data to new sheet - rename sheet based on criteria ? | Excel Discussion (Misc queries) | |||
Rename Sheet | Excel Discussion (Misc queries) | |||
how do I rename a sheet | New Users to Excel |