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

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
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,213,560
Messages
6,114,309
Members
448,564
Latest member
ED38

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