?
Solved

VBA to Select sheet if you only know part of the sheet name

Posted on 2014-09-01
2
Medium Priority
?
183 Views
Last Modified: 2014-09-01
is it possible to select a sheet in excel using VBA code if you only know part of the name

i.e. The sheet name is KIDQ - 85 accounts, tomorrow it could be KIDQ - 125 accounts etc

Thanks
0
Comment
Question by:Jagwarman
2 Comments
 
LVL 54

Accepted Solution

by:
Rgonzo1971 earned 2000 total points
ID: 40296709
Hi,

pls try

For Each sh In ActiveWorkbook.Sheets
    If sh.Name Like "KIDQ - * accounts" Then sh.Select
Next

Regards
0
 

Author Closing Comment

by:Jagwarman
ID: 40296728
brilliant thanks Rgonzo
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This article describes a serious pitfall that can happen when deleting shapes using VBA.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question