Help with macro

K

Ken G.

I have a workbook with 2 worksheets. Each contains a column of part numbers
with associated data. What I want to do is look at a part number in the
second sheet and bring over some of the data for that part number from the
first sheet.
I know I can't use Vlookup across 2 sheets, and in any case I don't want to
re-sort the data as required by vlookup. (its in date order, not part number
order) I'm guessing this can only be done with a macro.
Can anyone help?

Thanks.
 
B

Biff

Hi!
I know I can't use Vlookup across 2 sheets, and in any case I don't want to
re-sort the data as required by vlookup. (its in date order, not part
number
order)

You can use Vlookup across sheets and the data only needs to be sorted if
you're dealing with numeric values where there may not be an exact match.

Can you post a small sample of data?

Biff
 
K

Ken G.

Thanks Biff. Don't know where I got the idea vlookup wouldn't work across two
sheets. All done now.
 
C

chelles

How do you make the vlookup continue on down a column, basically repeating
the same function?
 
D

Dave Peterson

Dim myRng as range
dim myCell as range

with activesheet
set myrng = .range("A1",.cells(.rows.count,"A").end(xlup))
end with

for each mycell in myrng.cells
'do something to mycell
next mycell

is one way.
 
Top