Macro - import multiple excel sheets in one click

kanelones

Board Regular
Joined
Aug 25, 2010
Messages
103
Hi!

Maybe you can help me.

I just started using Microsoft Access, and need a little help.

I got several spreadsheets, named po(1).xls, po(2).xls, po(3).xls, a so on , to 150 files.
Need to import the data on those sheets to my table on Acces, but instead of repeating the process one at the time ( im using the saved imports screen option ) , wonder if i could repeat the process indefinitely, with an importing macro.
Can you help me to program it on access.
It will be very usefull for my daily work.

Thanks a lot for you help indeed.

Best Regards
Pablo
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
have trouble with this line

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, _
strTable, strPathFile, blnHasFieldNames
 
Upvote 0
Just worked perfect!

Now i need to fix other little detail...

each worksheet has 2 tabs.. need to eliminate the heather..( would be the first sheet ) any ideas to do that? ( this was REALLY helpfull!!!)
 
Last edited:
Upvote 0
need to delete one of the two sheets within the worksheet before the importation, have two sheets, "header" and "transations" the one i need to delete is named " header"
Can you be so great to show me the code to eliminate this sheet before ?
Thanks!
 
Last edited:
Upvote 0
If you look at the command it has an option for Range, after HasFieldNames ?

Try "Transations"

In fact that code specifies worksheets as well, so just transfer what you need.
 
Upvote 0
Sorry, you mean this line?

' Change this next line to True if the first row in EXCEL worksheet
' has field names
blnHasFieldNames = "Transactions"
 
Upvote 0
All done! Worked just fine! will save me hours!
You are Genious,, i appreciate your help.

Best Regards!
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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