Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Jim Jackson wrote: One method would be to insert an Input box into the code, asking what the new sheet's name should be. Title = "New Sheet Name" msg1 = "Insert the new name." newsheet = InputBox(msg1, Title) Sheets.Add ActiveSheet.Name = newsheet Good luck, Jim "Bob Phillips" wrote: Set an object variable to the sheet when you add Set newSheet = worksheets.Add then refer to the object thereafter, rather than activesheet or other such newSheet.Name = "Bob" -- HTH Bob Phillips Thanks for all your replies. As for those who said a newly added sheet would be automatically selected, I thought so too. But somehow, when I had some commands using "Activesheet" following the .Add, the commands were executed on another sheet in another workbook. I don't know how I managed to do that! (replace somewhere in email address with gmail if mailing direct) "davegb" wrote in message oups.com... When I add a new worksheet, how do I select it? I don't know which number it is, since I don't know how many sheets there are. Do I have to count the sheets to find out how many there are, then add the worksheet and select the next number higher than the count? Thanks for the help! |
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 | |||
why is ...xls] being added to the name on my worksheet? | Excel Worksheet Functions | |||
Stop Worksheet being added | New Users to Excel | |||
Add Hyperlink to newly added worksheet? | Excel Programming | |||
Macro to add formulas to added worksheet | Excel Programming |