Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add worksheet to userform based on sheet name criteria 1

Status
Not open for further replies.

owentmoore

Technical User
Jul 20, 2006
60
IE
Hi all,

I have a userform that when activated adds a link to each worksheet in my workbook on the userform. I need to add a line in my code that ensures only those worsheets with certain text in their name is shown on the user form.

E.G. a workbook with worsheet names "Sigma_Product", "Time_Product" and "Bearing". My criteria is that those worksheets that contain "_Product" in the names will be added to the userform. I know this can be done as I came accross the code several weeks ago but cannot find it again.

Thanks
Owen
 



Hi,
Code:
dim ws as worksheet
for each ws in worksheets
  if ucase(ws.name) like "*PRODUCT*" then
    'do your thing...
  end if
next



Skip,

[glasses] [red][/red]
[tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top