Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sam Sam is offline
external usenet poster
 
Posts: 699
Default HELP!: Popualte Access Database with data from 50 existing workboo

Hi All,

I have about 50 workbooks from which I need to populate the data into
Acccess database, Doing it manually would take weeks and it is laborous too.
Is it possible to write a Macro to do this job?

How can I populate the access database with Data in Sheet1 from all those
workbooks into access database?

Please Help

Thanks in Advance
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default HELP!: Popualte Access Database with data from 50 existing workboo

In the ACCESS IDE you can use code like this

Function GetData(sFilename, sRange)
On Error GoTo ErrorTrap
DoCmd.TransferSpreadsheet acImport, 8, "BondTable", sFilename, True,
sRange
Macro1_Exit:
Exit Function
ErrorTrap:
MsgBox Error$
Resume Macro1_Exit
End Function


as you can see, you pass the filepath/name and the range

build a table with two columns the first is the filepath, the second is the
name, then iterate through it,calling the function each iteration


"sam" wrote:

Hi All,

I have about 50 workbooks from which I need to populate the data into
Acccess database, Doing it manually would take weeks and it is laborous too.
Is it possible to write a Macro to do this job?

How can I populate the access database with Data in Sheet1 from all those
workbooks into access database?

Please Help

Thanks in Advance

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 139
Default HELP!: Popualte Access Database with data from 50 existing workboo

Per sam:
How can I populate the access database with Data in Sheet1 from all those
workbooks into access database?


My first try would be per Patrick's suggestion.

But I'd be ready for inconsistencies in the layouts and data on
the sheets - as in dollar amounts in most cells of a "Market
Value" column, but occasionally something like "No data
available, call Chris."

Another potential problem is header rows - the bane of most
imports I've done, especially when they contain information that
is vital to understanding the rows under them.

If it were too bad, I'd write a generic routine to go through a
named sheet row-by-row, column-by-column writing whatever was
found to a series of String fields in a temporary table and then
proceed to cleaning up the data in the temporary table.

If there were a lot of header rows, I'd circle back and modify
that generic routine to look for this and that value....
--
PeteCresswell
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP: VBA Code to extract data from an SQL Server database and put it into Access Database Clinton M James[_2_] Excel Programming 1 October 8th 07 12:44 AM
Macro to Export Selected fields to an Existing Access Database ernie Excel Programming 1 March 13th 06 05:01 PM
How to create lists of data quickly from a pre-existing database TAL27 Excel Discussion (Misc queries) 3 January 5th 06 04:59 PM
Data From Excel Range To Existing Access Table Jason Excel Programming 16 December 2nd 05 09:14 AM
vb code to export data into existing Access table desperate Excel Programming 2 November 19th 03 05:05 PM


All times are GMT +1. The time now is 01:43 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"