macro to import file into specified sheet

The Transporter

Board Regular
Joined
Jan 18, 2009
Messages
71
Hello,

I'm new to VB code and am hoping someone may be able to help me out.

Is it possible to have a macro that will (a) first prompt the user to select an excel file to import (the excel files to import are provided each month and data is always in "Sheet1"); then (b) select which worksheet to import the data (values only) from the selected file into?

I'd really appreciate any help with this...<!-- / message --><!-- attachments -->
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Hi,

It is possible, but can you paste an example from the workbook where the data is to be imported into,

And an example of one of the data Workbooks where the data is to be copied from.

Regards

ColinKJ
 
Upvote 0
Hi ColinKJ, thanks for following this up...

By example do you mean an attachment of the actual workbook?

Basically, the workbook where the data has to be imported into has 12 empty worksheets (each named by month -e.g. "Jul","Aug","Sep" etc).
There is then another seperate sheet (named "Summary") that summarises the data across the 12 sheets (e.g. via lookups, sums etc)

The workbooks where the values are to be imported/copied from each month include data in one worksheet ("Sheet1") from columns "A" through to "AZ" (# of rows vary from month to month). Each month this sheet is made available, I basically need to have the macro copy all its values into one of the 12 empty worksheets of the main workbook (e.g. for values in workbook provided for June data to be copied into the sheet named "Jun" of the main workbook)

Thanks again, really appreciate your help...
 
Upvote 0
Hi,

Understand what you want, I'll put something together and get back to you.

One thing, with the WBs you are copying from, what row dose the data start at 1 or 2.

Also, with the WB / Sheet that you are copying to, again do you want it to start on row 1 or 2.

ColinKJ
 
Upvote 0
Hi Colin,

Thanks again for this - the data in the WB to copy values from begin at row 1 - If you could have them copy to row 1 of the main WB that would be great...
 
Upvote 0
Hi,

I put together somehing for you to look at, if you can send me a private message with an email address, I'll send it over.

ColinKJ
 
Upvote 0
Thanks for emailing that across to me, I've tried it out and it definitely meets all requirements...

I really appreciate your time and efforts...
 
Upvote 0

Forum statistics

Threads
1,214,523
Messages
6,120,028
Members
448,940
Latest member
mdusw

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