file chooser

  • Thread starter Thread starter Diana
  • Start date Start date
D

Diana

I want users to be able to specify the directory where their files are
located. I manipulate a number of files, one person might have them under
c:\mydata, another might store them f:\test. Is there such a control in
Excel? Thanks in advance.
 
This might be what you are looking for:

Sub dk()

Wb = Application.Dialogs(xlDialogOpen).Show
MsgBox ActiveWorkbook.Name
End Sub

You can use the "previous" icon in the dialog box to walk back up the
directory chain.
 
If you are looking for a folder picker then try

Sub Macro()


Dim strFolder As String
With Application.FileDialog(msoFileDialogFolderPicker)
.AllowMultiSelect = False
If .Show = -1 Then
strFolder = .SelectedItems(1)
Else
MsgBox "No folder selected"
End If
End With

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top