Sheet Name Character String

  • Thread starter Thread starter trickdos
  • Start date Start date
T

trickdos

Hey guys, Thanks for your help in advance.

I need to run a macro on a database pull but if a 9 is in the first 1
characters of the name of the sheet, I need to do one specified action
if it is not there, I do another action.

I have this set up in excel, which works, but is very slow. Is ther
some way of doing this all within VBA, so the process can be sped up.
Thanks again for all your help
 
Trick,

In VBA:

If InStr(1, Left(ActiveSheet.Name, 10), "9") Then
MsgBox "It's contains a 9"
Else
MsgBox "It doesn't contain a 9"
End If

HTH,
Bernie
MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top