VBA Wildcard Characters

jedi160

Board Regular
Joined
Jan 8, 2005
Messages
57
Is it possible to use wildcard characters in the code for a macro? If so, where can I find the rules for using them?

Thanks,
Patrick
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Patrick

Depends what you want to use them for.
 
Upvote 0
There's a file that I would like to open up that uses attaches a date stamp in the filename to show when it was created. So the filename would be Johnny Appleseed 0506PM.xls. I've managed to use input boxes for dates, but for time of day defeats the purpose of making the process easier because I would have to go and check the time that it was run.

Would I be able to get Excel to open Johnny Appleseed ****.xls?

Thanks,
Patrick
 
Upvote 0
Patrick

I was afraid that was what you would be looking for, and I'm afraid the answer is no.

You can't use wildcards in filenames when opening them.

There could be other soultions however:

1 Application.Filesearch, though I believe that's not supported in Excel 2007.

2 Dir.

3 GetOpenFilename.
 
Upvote 0

Forum statistics

Threads
1,214,908
Messages
6,122,187
Members
449,072
Latest member
DW Draft

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top