Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using wildcard for checking whether files are open
I have macros that are used by several files.
One of the macros creates the toolbar, then I have a Closebook macro that checks whether how many files are still open. When the last file is being closed, the macro deletes the toolbar. I am starting to have more files that need to be checked and I am wondering if there is a way to put a wildcard in the checking of the name. For example, if workbook name is Price List*.xls then .... Here's the code that I currently have - Count = 0 ListName = "Price List - " For Each wkbk In Application.Workbooks If wkbk.Name = ListName & "Central.xls" Then Count = Count + 1 End If If wkbk.Name = ListName & "Eastern.xls" Then Count = Count + 1 End If If wkbk.Name = ListName & "Western.xls" Then Count = Count + 1 End If Next If Count <= 1 Then On Error Resume Next Application.CommandBars("Price List").Delete End If Thanks for your help. Monique |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do I toggle between 2 open excel files and leave both open | Excel Discussion (Misc queries) | |||
How to change default Open/Files of Type to "Microsoft Excel Files | Excel Discussion (Misc queries) | |||
using wildcard characters for filenames in externally linked files | Excel Discussion (Misc queries) | |||
how can I specific a folder with wildcard criteria and excel will import all the correct files in that folder? | Excel Discussion (Misc queries) | |||
file open via IE hyperlink causes already open files to shrink and tile | Setting up and Configuration of Excel |