Drop down list of filenames

martiniextradry

Board Regular
Joined
Mar 4, 2008
Messages
73
Is it possible to get a cell to have a drop down list of filenames?

Then can it have another drop down that gives the filenames in the subdirectory just chosen by that drop down?

Finally, can a formula then read both those selections for a formula?

ie C:\Documents and Settings\My Documents\{first drop down selection}\[{second drop down selection}.xls]

Many thanks
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Yes, with a fair bit of coding. I wouldn't bother. Look at GetOpenFileName as that's designed to give you the same end result as you're decribing with no coding effort and no maintenance issues:-
Code:
Application.GetOpenFilename("Excel Files (*.xl*), *.xl*")

You'd need to declare a string variable to hold the filename and then test whether the user hit Cancel, so you might end up with code looking somehting like this:-
Code:
Dim sFilename As String
 
sFilename = Application.GetOpenFilename("Excel Files (*.xl*), *.xl*")
If sFilename = "False" Then Exit Sub
 
[COLOR=green]' continue[/COLOR]
MsgBox "You chose " & sFilename
[COLOR=green]' open the file or do whatever else you wanted to do with the filename[/COLOR]
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,827
Members
452,946
Latest member
JoseDavid

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