pass userform.getopenfilename to spreadsheet variable

Mr_Semper

New Member
Joined
Apr 21, 2002
Messages
10
I'm using a form to get input txt file, I then need to pass the filename to my spreadsheet so I may inport the file.
Any ideas ?? Thanks,
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
On 2002-04-22 16:09, Mr_Semper wrote:
I'm using a form to get input txt file, I then need to pass the filename to my spreadsheet so I may inport the file.
Any ideas ?? Thanks,

Pass it to where in the spreadsheet? Do you want to copy the name into a cell? Or what?

If you want to import the text file with VBA, that can also be done. Please be a little more specific and I or someone else will be more likely to help.
 
Upvote 0
On 2002-04-22 16:09, Mr_Semper wrote:
I'm using a form to get input txt file, I then need to pass the filename to my spreadsheet so I may inport the file.
Any ideas ?? Thanks,

MyFile= Application.GetOpenFilename(Title:="Import file")

Will prompt you for the file to open and store it in the variable MyFile. You can then write the MyFile string to the worksheet (???) or use Workbooks.OpenText to open the file as you'd like.

HTH,
Jay
 
Upvote 0

Forum statistics

Threads
1,214,893
Messages
6,122,121
Members
449,066
Latest member
Andyg666

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