PDA

View Full Version : Tryin to get some Excel fields into Access...



rockdrigo
06-05-2008, 03:44 PM
Hey there,
im trying to automate my office grudge, and im bangin my head after a couple of days of cutting&pasting code im getting from your great forum, but im not going anywhere! anyway,

I have a 100 xls files in C:\ and I need to get a couple of cells from each of this folders, say D8 and H14:L14, and add these values to an Access 2003 table,

could you help me? none of my cut&paste thing seems to be workin for me...:banghead:

Rodrigo

Charlize
06-06-2008, 04:41 AM
This is an example of excel workbook with some code to update a specified acces database. You could probably adapt the routine with the sql command that is used to automate the updating of your excel files to acces.

Save both files of this zipfile into the same directory.

I hope it will give you some ideas.

Charlize

Take a look at this thread for the zipfile : http://vbaexpress.com/forum/showthread.php?t=15987

CreganTur
06-06-2008, 05:17 AM
Comment removed: I thought you wanted to pull in entire fields, then I reread and saw you only want specific fields.

rockdrigo
06-06-2008, 10:40 AM
thks a lot! this code seems to be useful, however, what i havent been able to do is to iterate over my 100+ files to get those same fields.:dunno

Charlize
06-07-2008, 03:15 PM
Take a look at the dir syntax, ie. type dir in the vb editor, put the cursor somewhere in the word that you typed, hit F1. This will give you some clues to build a loop around the commands that takes care of the transfer from excel to access.

Charlize

ps.: What do you mean by
this code seems to be useful