macro to select file for import.

riverotter

New Member
Joined
Aug 8, 2010
Messages
5
Hello Excel Experts. I have sheet4 of my workbook designated as the destination for imported .CSV files. The files data is pre-formated to fit into columns A & G. The rest of the sheets in the workbook read and pull the data from there. I have no trouble manually selecting the needed file and dropping it into place, but I am building this interface for people who are not so computer savoy.My hope is to have a macro assigned to a button on the screen that will,when clicked, bring up the standard windows "select file" menu and allow them to click on whichever pre-formated document they want to work with. I have seen ways that will build system specific approaches to this, but I need one that will work no matter which computer it is run on. Is there any hope for me in this?

I look forward to your expertize on this, and thank you in advance,

Aaron
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
How about something like:

Code:
Sub getFile()
    Application.Dialogs(xlDialogOpen).Show
End Sub

HTH
 
Upvote 0
OKay, it is just not fair that you can write a one line code that is more powerful and useful then 2 hours of me coding on my own :)

Anyway, just as you predicted, that opened the window and allowed me the access I needed. However, I am still hoping to get the macro to auto import the data to sheet4 columns a & g once the file has been selected. I know it is a bother and is just as easy to do it manually, but I am afraid the learning curve on my coworkers is not so good when it comes to computers.

Any further thought on this puzzle?
 
Upvote 0

Forum statistics

Threads
1,223,243
Messages
6,170,964
Members
452,371
Latest member
Frana

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