ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sheet Name Character String (https://www.excelbanter.com/excel-programming/312178-sheet-name-character-string.html)

trickdos[_15_]

Sheet Name Character String
 

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

--
trickdo
-----------------------------------------------------------------------
trickdos's Profile: http://www.excelforum.com/member.php...nfo&userid=940
View this thread: http://www.excelforum.com/showthread.php?threadid=26550


Bernie Deitrick

Sheet Name Character String
 
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

"trickdos" wrote in message
...

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 10
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 there
some way of doing this all within VBA, so the process can be sped up.
Thanks again for all your help.


--
trickdos
------------------------------------------------------------------------
trickdos's Profile:

http://www.excelforum.com/member.php...fo&userid=9405
View this thread: http://www.excelforum.com/showthread...hreadid=265509





All times are GMT +1. The time now is 01:24 AM.

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