Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Sep 2003
    Location
    Toronto, Ontario, Canada
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Browsing for path (Excel 2003 VBA)

    Another question: how do I give the user the option to click a button and browse for a path and store the result in a text box?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Browsing for path (Excel 2003 VBA)

    With code like this:

    Sub BrowseFolder()
    With Application.FileDialog(msoFileDialogFolderPicker)
    If .Show = True Then
    Range("A1") = .SelectedItems(1)
    End If
    End With
    End Sub

    Put a button from the Forms toolbar on your worksheet, and assign the BrowseFolder macro to it.

  3. #3
    2 Star Lounger
    Join Date
    Sep 2003
    Location
    Toronto, Ontario, Canada
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Browsing for path (Excel 2003 VBA)

    Which value woud l return to place this path in a textbox?

  4. #4
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Browsing for path (Excel 2003 VBA)

    Is this what you need?

    With Application.FileDialog(msoFileDialogFolderPicker)
    If .Show = True Then
    ActiveSheet.Shapes.AddTextbox(msoTextOrientationHo rizontal, _
    100, 80, 180, 80).TextFrame.Characters.Text = .SelectedItems(1)
    End If
    End With
    -John ... I float in liquid gardens
    UTC -7ąDS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •