Help with VLookup

TSoren23

New Member
Joined
Sep 11, 2006
Messages
16
In a user form I want to enter a value in a text box (txtItem) and have it return a value in another text boxs (txtProduct), (txtProC), and (txtOpt).
I have formulas in a work sheet that now displays the value from the vlookup.

this would be the txtItem;

=IF(B4="","",VLOOKUP(B4,'\\Owensrv\owen\Management Projects\Plant Governance\[Rate Lookup Tool.xls]North'!$A:$D,2,FALSE))

This is how far I got before I got stumped trying to do it in VBA;

Set wb = Workbooks\\Owensrv\owen\Management Projects\Plant Governance\[Rate Lookup Tool.xls]")
Set ws = wb.Sheets("North")
Set rng = ws.Range("$A:$D")

ActiveCell.Value =
Application.WorksheetFunction.VLookup(ActiveCell.Offset(?,?).Value, rng,
2, False)

These are the other two vlookup formulas;
(txtProC)
=IF(B4="","",VLOOKUP(B4,'\\Owensrv\owen\Management Projects\Plant Governance\[Rate Lookup Tool.xls]North'!$A:$D,4,FALSE))

(txtOpt)
=VLOOKUP(E4,'\\Owensrv\owen\Management Projects\Plant Governance\[Rate Lookup Tool.xls]North'!$F:$I,4,FALSE)

Can any help me out here.

Thanks
 

Some videos you may like

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Watch MrExcel Video

Forum statistics

Threads
1,113,953
Messages
5,545,145
Members
410,666
Latest member
Al3cs
Top