Revise this code to select a different Path. HOW?

Mister H

Well-known Member
Joined
Mar 6, 2002
Messages
1,507
Hi All:

I am trying to alter this bit of code so that when the dialog box opens the Look in: folder will be the folder that open file is stored in. I have used this snippet of code before:

Code:
TempFilePath = ThisWorkbook.Path & "\"
However I am not sure on how to implement it below OR IF it can be implemented. :confused:

I hope this makes sense to someone... :)
Code:
    Dim fd As FileDialog
    Dim fn As String
    
    Set fd = Application.FileDialog(msoFileDialogOpen)
    fd.Title = "** Open the Receipt Register text file in order to convert it into Excel:  **"
    Dim vrtSelectedItem As Variant
    With fd
        .Filters.Clear
        .Filters.Add "All files", "*.txt"
        
        If .Show = -1 Then
            For Each vrtSelectedItem In .SelectedItems
             fn = vrtSelectedItem
             
            Next vrtSelectedItem
        Else
        End If

THANKS,
Mark :biggrin:
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
THANKS tweedle, I just saw your post. I will try out your solution as soon as I return to the office. I appreciate your assistance.

Have a GREAT weekend,
Mark
:beerchug:
 
Upvote 0
Hi tweedle:

I just wanted to let you and anyone else that may look at this post that your suggestions resolved my problem. :biggrin:

THANKS Again,
Mark :)
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,292
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top