PDA

View Full Version : Need Help with exporting from Access to Excel



ckeola
08-12-2010, 11:09 AM
I am at my ropes end with this... I am very new to vba.

I have a db with a tbl and a form.
I have an Excel Workbook with multiple spreadsheets.
In a spicific spreadsheet I add data to the bottom of a long list of data.
That data starts in Column A and goes through Column T.
Every Row is a Single record(Company name, title, phone number, etc.)

spreadsheet format: record ID first name last name title company address and so on
84395 John Smith President Random Inc. 555 Main St yes

NOTE: the record ID's will already exist before the data gets to me, and will need to stay the same.

The db that I am using: "my_db"
The tbl in "my_db" is: "my_tbl"
The already existing Excel Workbook: "my_excel"
The spreadsheet to be used in "my_excel" is: "my_spreadsheet"


I want to:
push a button on my form and the following happens...
- all the data in "my_tbl" is selected and copied(but NOT the headers)

- paste copied data(something comparable to paste special/CSV) into the first empty cell of Column A in "my_spreadsheet". [The Columns in "my_spreadsheet" have formulas and formatting that should not be altered]

- I do not want "my_excel" to be closed after this operation.

NOTE: "my_excel" will already be open, but minimized.
NOTE: I am not allowed to change any formatting/code at all in "my_excel", Because I am not the only one who uses this Excel doc.

I have tried and tried... now I just want to put in the code so that I can shave minutes off of this task, which I do all day.

Please help. :mkay

geekgirlau
08-12-2010, 04:00 PM
Here are a couple of links to get you started:

Link 1 (http://www.vbaexpress.com/forum/showthread.php?t=32475&highlight=copyfromrecordset)
Link 2 (http://bytes.com/topic/access/answers/771119-export-access-excel)
Link 3 (http://www.excelguru.ca/node/23)