Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
Trying to find a way, using VBA, to locate and activate a sheet by name, using a wildcard search. The workbooks I need to open are not consistently organized and sheet names are different, but all contain "Jan" thru "Dec" in some form. Ex: Platform1 (JAN),Platform2 JAN, Platform3Jan, etc... Much appreciated. - Randy |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One way:
Public Sub ActivateJan() Dim ws As Worksheet For Each ws In ActiveWorkbook.Worksheets If UCase(ws.Name) Like "*JAN*" Then ws.Activate Exit Sub End If Next ws MsgBox "No JANs found" End Sub In article , RAP wrote: Hello, Trying to find a way, using VBA, to locate and activate a sheet by name, using a wildcard search. The workbooks I need to open are not consistently organized and sheet names are different, but all contain "Jan" thru "Dec" in some form. Ex: Platform1 (JAN),Platform2 JAN, Platform3Jan, etc... Much appreciated. - Randy |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Works just fine. Thank you! Apparently, I just have a thing with syntax. I
was close, but you nailed it. Thanks again, Randy "JE McGimpsey" wrote: One way: Public Sub ActivateJan() Dim ws As Worksheet For Each ws In ActiveWorkbook.Worksheets If UCase(ws.Name) Like "*JAN*" Then ws.Activate Exit Sub End If Next ws MsgBox "No JANs found" End Sub In article , RAP wrote: Hello, Trying to find a way, using VBA, to locate and activate a sheet by name, using a wildcard search. The workbooks I need to open are not consistently organized and sheet names are different, but all contain "Jan" thru "Dec" in some form. Ex: Platform1 (JAN),Platform2 JAN, Platform3Jan, etc... Much appreciated. - Randy |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Automatically update SheetName in workbook sub if SheetName changes | Excel Discussion (Misc queries) | |||
Does anyone see this .xls]sheetname? | Excel Worksheet Functions | |||
Does anyone see this .xls]sheetname? | Excel Discussion (Misc queries) | |||
search question | Excel Programming | |||
SheetName | Excel Programming |