473,394 Members | 1,889 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to Import multiple excel spreadsheats?

Dear all,

I have an excel workbook which contains over 200 spreadsheets with identical
data structure. How can I automatically import them into one access table?

I am using Office 2K.

Thanks and regards,
Arthur Cheung
Nov 13 '05 #1
1 1364
Without writing code, you might want to paste all the data to one sheet
(if possible), or export all data to *.CSV files and put those
together.

If that would take too long, do something like this:

Go into the excel spreadsheet and name the ranges that include the data
on each sheet. Name them "GetMe1", "GetMe2", etc. Also, make sure you
have field names that are identical to the field names in the
destination table.

Code would look something like this (air):

Sub foo()
Dim i As Integer
Dim strNamedRange As String
Dim strDestinationTable As String
Dim strFileName As String
strDestinationTable = "MyTable" 'Input table name here
strFileName = "c:\MyFile.xls" 'Input filename here
For i = 1 To 200
strNamedRange = ""
strNamedRange = "GetMe" & CStr(i)
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel8, _
strDestinationTable, strFileName, True, strNamedRange
Next
End Sub

Johnny
j[deleteme}meredith AT Google's Mail

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: madeleine | last post by:
I'm hoping the answer to this is that I'm just doing something silly, but I'm really scratching my head over this one. I'm importing data from multiple workbooks, each workbook has a sheet called...
3
by: MarcGA | last post by:
(Excel 2003, Access 2003, XP, novice user here) I can't get Access to accept multiple Excel files to the same table. I can import the spreadsheets to a new table, but I need to import 23...
1
by: DThreadgill | last post by:
I have a spreadsheet with about 35 tabs that I need to import into one table in Access. I found this link http://www.thescripts.com/forum/thread650662-import+multiple+tabs.html and changed some...
7
by: Ivan | last post by:
Hello group! I need to create import utility. My main concern is how will I support multiple file types. XLS, CVS, etc? Is there any libraries I can use and distribute (part of framework?) That...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.