ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   sheet names (https://www.excelbanter.com/excel-programming/291525-sheet-names.html)

drabbacs

sheet names
 
How would I make the "020304" portion of the sheet name in
the following command into a wildcard?

Sheets("Mobile 020304").Select

That is, I want a command that would work with "Mobile
020304" or "Mobile 021004".

I tried "Mobile "& "*" and "Mobile " & "?" but no luck.

Thanks in advance
Drabbacs



Ron de Bruin

sheet names
 
Hi drabbacs

Don't know if you want this ??

You can use this run code on all sheets that start with "Mobile"

Sub test()
Dim sh As Worksheet
For Each sh In ThisWorkbook.Worksheets
If Left(sh.Name, 6) = "Mobile" Then

MsgBox sh.Name
'your code

End If
Next sh
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"drabbacs" wrote in message ...
How would I make the "020304" portion of the sheet name in
the following command into a wildcard?

Sheets("Mobile 020304").Select

That is, I want a command that would work with "Mobile
020304" or "Mobile 021004".

I tried "Mobile "& "*" and "Mobile " & "?" but no luck.

Thanks in advance
Drabbacs






All times are GMT +1. The time now is 09:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com