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

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,357
Office Version
  1. 365
Platform
  1. Windows
Patrick

Depends what you want to use them for.
 

jedi160

Board Regular
Joined
Jan 8, 2005
Messages
57
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
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,357
Office Version
  1. 365
Platform
  1. Windows
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.
 

Forum statistics

Threads
1,181,647
Messages
5,931,207
Members
436,783
Latest member
darkwingduck1

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
Top