Vlook up Help

confusedjo

New Member
Joined
Aug 16, 2011
Messages
28
I currently have a workbook with 2 sheets -

sheet one (event) containing columns:-
Membership No(d cell) Name(e cell) Grade(f cell)

sheet two (data) containing columns with the data
Membership No (a cells) Name(b cell) Grade(c cell)

what i am wanting to do is pull the name and grade information from sheet2 when i enter the membership no in sheet one. I have been able to do this with vlook formula but would like to do this for the whole worksheet without formulas and having trouble writing a code in vba to complete this - any help would be greatly appreicated (totally new to coding).
Any help is greatly appreciated
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
What is the code you have now?
 
Upvote 0
currently dont have a code (totally new to coding)
the formula i can use to obtain the results is:-
=VLOOKUP(D6,DATA!A1:B200,2,FALSE) this returns the data i require but only for the one cell and i would like to run this for the whole form.
 
Upvote 0
Then consider:

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Count = 1 Then
        If Target.Column = 4 Then
            On Error Resume Next
            Target.Offset(, 1).Resize(, 2) = Sheets("DATA").Columns(1).Find(Target.Text, , xlValues, xlWhole).Offset(, 1).Resize(, 2).Value
            On Error GoTo 0
        End If
    End If
End Sub
 
Upvote 0
PREFECT!!

If you had the time would you mind explaining the code to me, i understand the formula required but unsure how this is translated to coding.

Thank you so much for your time.
 
Upvote 0
At each change of a cell in column D (= 4), the cell that is 1 cell to the right of the changed cell (Target) is taken. That cell and the one next to it (Resize(,2)) are filled with 2 cells coming from sheet Data. There, I do a Find action on column A.
 
Upvote 0

Forum statistics

Threads
1,224,552
Messages
6,179,487
Members
452,917
Latest member
MrsMSalt

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top