Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Absolutely charming. This is magnificent. Thank you!
"Chip Pearson" wrote: You can name the worksheet when you create it. ThisWorkbook.Worksheets.Add().Name = "Remaining" Or, since creating a sheet makes it the active sheet, you could use ThisWorkbook.Worksheets.Add ActiveSheet.Name = "Remaining" If you really want to use a loop, try Dim WS As Worksheet For Each WS In ThisWorkbook.Worksheets If StrComp(Left(WS.Name, 5), "Sheet", vbTextCompare) = 0 Then WS.Name = "Remaining" Exit For End If Next WS Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group, 1998 - 2009 Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Fri, 27 Mar 2009 12:51:01 -0700, MCheru wrote: I have a macro that creates a new worksheet when I run it. The given name could be Sheet 1, Sheet 2, Sheet 3, etc. The point is that I never know what number Sheet the macro will give the worksheet because it changes each time I run it. I want to create a code that will find the worksheet with Sheet in the name and change the name of the worksheet to Remaining. Here is what I have so far. newsht.Name = "Remaining" |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
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 | Excel Discussion (Misc queries) | |||
plot graph from multiple worksheet as embedded chart object on every worksheet | Excel Worksheet Functions | |||
Upload multiple text files into 1 excel worksheet + put the filename as the first column in the worksheet | Excel Worksheet Functions | |||
I want in one worksheet to relatively link to/reference cells in another without changing the format of the current worksheet. | Excel Discussion (Misc queries) |