Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to "match" partial file name
Greetings:
When file is open and special menu item selected, the first thing that needs to be done is determine if the file name start with "EM_". If if does, then call up message, "not allowed" and exit if is doesn't, then continue with process. Please see my efforts, below Sub CheckFileName() ' if File Name starts with 'EM_', then process is not allowed. ' When click on OK, exit macro project ' If does NOT start with 'EM_', then Proceed ' Call EMailAnswerC1A Dim FName As String If FName = "EM_*" Then Call NotAllowed Else: Call EMailAnswerC1A End If How (or what) can I use as a wild card, to make this work. (there is no fixed file name length) |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to "match" partial file name
if left(FName,3) = "EM_" then
call NotAllowed -- AP "BEEJAY" a écrit dans le message de news: ... Greetings: When file is open and special menu item selected, the first thing that needs to be done is determine if the file name start with "EM_". If if does, then call up message, "not allowed" and exit if is doesn't, then continue with process. Please see my efforts, below Sub CheckFileName() ' if File Name starts with 'EM_', then process is not allowed. ' When click on OK, exit macro project ' If does NOT start with 'EM_', then Proceed ' Call EMailAnswerC1A Dim FName As String If FName = "EM_*" Then Call NotAllowed Else: Call EMailAnswerC1A End If How (or what) can I use as a wild card, to make this work. (there is no fixed file name length) |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to "match" partial file name
Ardus:
I'll repost, since I have some related issues. "BEEJAY" wrote: Ardus: I made the adjustments as shown, but I cannot get it to work. Every time it goes to the "else" statement, even though the active file does start with "EM_". What am I overlooking? "Ardus Petus" wrote: if left(FName,3) = "EM_" then call NotAllowed -- AP "BEEJAY" a écrit dans le message de news: ... Greetings: When file is open and special menu item selected, the first thing that needs to be done is determine if the file name start with "EM_". If if does, then call up message, "not allowed" and exit if is doesn't, then continue with process. Please see my efforts, below Sub CheckFileName() ' if File Name starts with 'EM_', then process is not allowed. ' When click on OK, exit macro project ' If does NOT start with 'EM_', then Proceed ' Call EMailAnswerC1A Dim FName As String If FName = "EM_*" Then Call NotAllowed Else: Call EMailAnswerC1A End If How (or what) can I use as a wild card, to make this work. (there is no fixed file name length) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Selecting "Save As" adds "Copy of" to file name- MS Excel 2007 | Excel Discussion (Misc queries) | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
Lost "File Menu" - now it's "Edit / View / Insert.." but no "F | Excel Discussion (Misc queries) | |||
How to replace "#N/A" w "0"when vlookup couldn't find the match? | Excel Discussion (Misc queries) | |||
Problem- Recording macros for "file save" and "File open" | Excel Programming |