View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Robert Crandal[_2_] Robert Crandal[_2_] is offline
external usenet poster
 
Posts: 158
Default Let a user choose a folder?

I put this code in a Sub and I got an error message that
said something like "Exit not allowed in Sub". Should
I replace that "Exit Function" code with something else?
What is that code for anyways?

Thanks!


"GS" wrote in message
...

This will display the dialog to allow user to choose a folder. It returns
the full path.

With Application.FileDialog(4) 'msoFileDialogFolderPicker
If .Show = False Then Exit Function 'User cancelled
sPath = .SelectedItems(1)
End With

--
Garry