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

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

Richard Schollar

MrExcel MVP
Joined
Apr 19, 2005
Messages
23,707
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,191,717
Messages
5,988,259
Members
440,146
Latest member
rgomes8

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