View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Patrick Molloy[_2_] Patrick Molloy[_2_] is offline
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