File System Object

magsmith

New Member
Joined
Jun 23, 2008
Messages
1
I've created a tool that browses for a folder then checks the workbook for criteria and highlights cells depending if they meet it or not. I'm using a file system object to browse for a folder. It works fine if there is only one file in the folder, but not if there are multiple. Any suggestions on how to browse for a specific file?
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Hi

You can use the ancient GetOpenFileName method:

Code:
Dim varFile As Variant
varFile = GetOptnFileName()
If varFile<>False Then Workbooks.Open varFile

It's worth checking out the VBA Help topic on GetOpenFileName as there are parameters (eg file extension) that you can pass to the method to direct users.
 
Upvote 0

Forum statistics

Threads
1,215,746
Messages
6,126,642
Members
449,325
Latest member
Hardey6ix

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