LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default Assign a folder path to a variable

Thank you.
Fred

"Gary''s Student" wrote:

To get the name & path from the dialog:

Sub WhichTwo()
Set x = Application.FileDialog(msoFileDialogFolderPicker)
x.Show
s = x.SelectedItems(1)
MsgBox (s)
End Sub
--
Gary''s Student - gsnu200800


"Fred" wrote:

Hi
I'm trying to get the browseforfolder path assigned to a variable as I need
to use that path later in other code. Here is what I have so far:

Dim FolderName As String

Application.FileDialog(msoFileDialogFolderPicker). InitialFileName =
"H:\EFT\EFT Payments\2008\" 'Specify folder path
If Application.FileDialog(msoFileDialogFolderPicker). Show = -1 Then
Range("B40").Value = FolderName
Else
Range("B41").Value = "Don't do stuff"
End If

Where am I going wrong?

Thanks
Fred

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you assign a Workbook Location Path to a cell? bcw_now[_2_] Excel Worksheet Functions 1 May 8th 09 12:25 AM
Remove end folder from path found with ThisWorkbook.Path command ? dim Excel Programming 9 April 23rd 08 06:04 AM
Assign cell value to equal file path for loading Rookie_User Excel Programming 2 February 7th 07 09:27 PM
How to List the names of the subfolders present in the folder (path of folder is given in the textbox by user ) divya Excel Programming 3 November 30th 06 11:34 AM
Get Folder Path RNM[_2_] Excel Programming 1 August 8th 04 03:19 AM


All times are GMT +1. The time now is 02:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"