Create a Excel document using VBA or VB using specific MS ACCESS Data tables and fields to create a variety of excel worksheets with specified names on the sheets and data placed in specified location on certain sheets.
The data is in several tables in the database and the table names are know and the fields are know, with this information known I then know where I want to place the information in the excel document what worksheet by name and the cells that it can be pasted to. I have been reviewing the object model for vba and access and excel and am unsure how to accomplish this. I have over 150 database where I need to pull several small pieces of data from. I will provide samples below.
The example is as follows: ultimatly saved as an excel firstphase.xls
( there will be several worksheets but the first will be called - worksheet name: buildings
The cells that the various data will be places is as follows:
from ms access database named: probuild
the table that data is to be pulled form is tblbuildingcodes
and the first field fromt he table that I need all records from buildingname this information in asc order
i.e. probuild.tblbuildingcodes.
buildingna
me
will be placed in cell starting at A6 ( down the page)
the next field from the table will be buildingcode
i.e. probuild.tblbuildingcodes.
buildingco
de
and this will be placed in the excel worksheet starting at cell d6
I need to label with fix text cells a1, a2,a3,a4, a6, and the same for d1-5.
i.e. cell d1 builing
d2 western
d3 sections
fieldname (from tblbuildingcode) ( if this can be done other wise I will jsut hard code it np.)
then save the excell sheet to the same folder where the database is located and called firstphase.xls
I hope that there is someone out there that can help me with this issue, I have been going over the internet looking for help with creating excel docs using vba in ms access but have not found enough defined to aid in the process I am trying to work out otherwise it will take forwaver to copy and paste the data from 150 or more different databases.
Thank you very much!
Start Free Trial