Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Probably simple
Hi,
Simple code I'm sure, I just can't get my head round it. I've a number a worksheets that could be added in any order, I need to extract the sheet which has a name starting with "ilo" and rename it to whatever I want. For Each ws In ActiveWorkbook.Worksheets If Worksheet.Name Is Left("ilo", 3) Then ws.Activate Exit Sub End If This is what I'm working with, Can anyone amend so I can get this changed? Thanks Carl |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Probably simple
Hi,
Maybe this Sub nn() Dim ws As Worksheet For Each ws In ActiveWorkbook.Worksheets If Left(ws.Name, 3) = "ilo" Then ws.Name = "MyName" Exit Sub End If Next ws End Sub Mike "Carlos" wrote: Hi, Simple code I'm sure, I just can't get my head round it. I've a number a worksheets that could be added in any order, I need to extract the sheet which has a name starting with "ilo" and rename it to whatever I want. For Each ws In ActiveWorkbook.Worksheets If Worksheet.Name Is Left("ilo", 3) Then ws.Activate Exit Sub End If This is what I'm working with, Can anyone amend so I can get this changed? Thanks Carl |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Probably simple
Another If..Then test possibility is this...
If ws.Name Like "ilo*" Then -- Rick (MVP - Excel) "Mike H" wrote in message ... Hi, Maybe this Sub nn() Dim ws As Worksheet For Each ws In ActiveWorkbook.Worksheets If Left(ws.Name, 3) = "ilo" Then ws.Name = "MyName" Exit Sub End If Next ws End Sub Mike "Carlos" wrote: Hi, Simple code I'm sure, I just can't get my head round it. I've a number a worksheets that could be added in any order, I need to extract the sheet which has a name starting with "ilo" and rename it to whatever I want. For Each ws In ActiveWorkbook.Worksheets If Worksheet.Name Is Left("ilo", 3) Then ws.Activate Exit Sub End If This is what I'm working with, Can anyone amend so I can get this changed? Thanks Carl |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Probably simple
Thanks Mike, Patrick,
That's done the trick, Much appricated for the quick response "Mike H" wrote: Hi, Maybe this Sub nn() Dim ws As Worksheet For Each ws In ActiveWorkbook.Worksheets If Left(ws.Name, 3) = "ilo" Then ws.Name = "MyName" Exit Sub End If Next ws End Sub Mike "Carlos" wrote: Hi, Simple code I'm sure, I just can't get my head round it. I've a number a worksheets that could be added in any order, I need to extract the sheet which has a name starting with "ilo" and rename it to whatever I want. For Each ws In ActiveWorkbook.Worksheets If Worksheet.Name Is Left("ilo", 3) Then ws.Activate Exit Sub End If This is what I'm working with, Can anyone amend so I can get this changed? Thanks Carl |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
IF formula-simple question; simple operator | Excel Discussion (Misc queries) | |||
Simple problem, simple formula, no FUNCTION ! | Excel Worksheet Functions | |||
Simple Simple Excel usage question | Excel Discussion (Misc queries) | |||
Make it more simple or intuitive to do simple things | Charts and Charting in Excel | |||
simple question, hopefully a simple answer! | Excel Programming |