PDA

View Full Version : VBA to grab data from other .XLS file



definity
09-11-2007, 08:32 AM
i i have two files and i would like one sheet to grab data from the other one by using keywords, basicly if someone types in kitchen or bathroom the number that are associated with that are automaticly entered into the right collums same fields on the other file, at the moment i am using a formula like this
VLOOKUP(A6,'/Users/TheDirectoryItIsIn/[Roomsizes.xls]Rooms'!masterdims,(COLUMN(B6:F6)),FALSE)
Rooms is the name of the array i made on the sheet i wanted it to get the data from. But i would like to do it in VBA becuse i want a option where when i load up the script it will open up a inputbox or a openfile windows where u can select a file for it to read from is his possible, if so how???

definity
09-12-2007, 02:42 AM
Bump:hi:

definity
09-12-2007, 06:44 AM
cant u atleast tell me if it is possible or not?!?!?!

lucas
09-12-2007, 06:53 AM
I would say that it is possible but your explaination is vague. It might help if you would post example workbooks with a better explaination.

Sounds like you're trying to use a closed workbook for a database of products, etc. and fill in forms on an open workbook....

definity
09-18-2007, 02:25 AM
ok well i show you the two work books i am working with the first one is building 1.xls
(http)download.yousendit.com/1D636EA57AAC972A
and the second file is roomsizes.xls
(http)download.yousendit.com/DA1D53182AD93323

replace (http) with http in your adress bar

basicly i want to grab data off one xls file and put it into certain fields on the second but not all the fields. And it would also be extremly usefull if when u open up the spread sheet a open file box apears and you select a file you would like to grab the data off so when you type in keywords it will look on the second sheet that you specified at the start up of the spread sheet scans for the keyword once it find the keyword it would fill in the row of which you type the keyword.

(in other words. The first file you specify at start up will have all the keywords and data on the second file will be blank so when you type in a keyworkd such as Bathroom on the second file it will check the first sheet and then see the keyword and fill in the rows of data on the second file)
hopefully you can understand it now
and also one more question would it be possible to select multiple closed workbooks at the start up so one open workbook could search for keyworkd say between 3 closed workbooks?
many many many thanks.
Def.