PDA

View Full Version : Excel VLOOKUP Help


sq764
02-01-2004, 12:11 PM
I hope this makes sense:

Let’s say I have 2 files, one file we will call ‘file 1’ and the other ‘file 2’.

Let’s now say that file 1 will be the sheet I am working on and file 2 will be a different sheet each time, but will always carry the exact same file name each time.

If I wanted to use the ‘VLOOKUP’ function in a macro on file 1, referencing data on file 2, what is the best way to do it? Or is there a better way to do it?

(More info available if needed)

Tom
02-01-2004, 12:31 PM
Are you looking to have some constants in the one file to use in formulae in the other?

sq764
02-01-2004, 12:36 PM
I wanted to run a macro that would paste the vlookup function that references the data on the other sheet. The referenced sheet would have the same format of data each time, just different figures.

For instance, the file I want to reference will have:

A 2
B 4
C 18
D 1

The next day, it may have:

A 4
B 17
C 4
D 10

I just wanted to save a macro that pastes the VLOOKUP function to references cell A2 or B2, etc..

hcap
02-01-2004, 12:44 PM
If all your info in file 2 is on one row going accross, vlookup can be used easily.
If your info is on multiple rows, filtering
using the advanced filter is pretty good.
Database functions are also usable.

How you do determine which sheet file 2 is on ? Or is it different each time?
How many sheets are in your workbook?

More info is needed

sq764
02-01-2004, 01:03 PM
Oh yeah..

well 2 variables here:

1) There is only 1 sheet all the time

2) The actual file is a .dbf file, but I wasn't sure if you could reference a dbf file or if I had to change it to excel to be referenced..

hcap
02-01-2004, 01:18 PM
Excel can open dbf files.

You might be able to reference a closed dbf file, (I think uisg ADO or DAO. But I am not sure), opening it in excel is easier
At least for me.

Out of curriosity, are these the trackmaster dbf files in the harness download? Something like 7 or 8 seperate dbf files when you unzip the main file?

sq764
02-01-2004, 01:26 PM
precisely

hcap
02-01-2004, 01:39 PM
How many of these seperate dbf files do want to access-you know you get them all to open on seperate sheets, and pull out what you need using key fields as the "skeleton" to build your queries around.

But if you only need one file as you indicate, shouldn't be to tough