Consulting

Results 1 to 2 of 2

Thread: How to post only the SaveAs location that a user selects to a Worksheet cell

  1. #1
    VBAX Mentor
    Joined
    Jan 2008
    Posts
    384
    Location

    How to post only the SaveAs location that a user selects to a Worksheet cell

    Trying to write the SaveAs location that a user selects to a Worksheet cell,
    and to write ONLY the location without the filename used in Cell A22 & use it in a Variable.

    I tried modifying code like this, http://software-solutions-online.com...aveasfilename/

    but, still inelegant and not working for me. Any ideas?

  2. #2
    VBAX Mentor
    Joined
    Jan 2008
    Posts
    384
    Location
    To anyone that was interested, I got this bit to work for me.

    Sub PathOnly()
    SelectedFiles = Application.GetOpenFilename( _
             filefilter:="Excel Files (*.xls*), *.xls*", MultiSelect:=False)
    If InStrRev(SelectedFiles, "\") > 0 Then
      FolderLocation = Left(SelectedFiles, InStrRev(SelectedFiles, "\"))
    End If
    Cells(22, 1) = FolderLocation   ' TO POST TO A22
    End Sub

Posting Permissions

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