VBA Vlookup help

FootBallBat

Board Regular
Joined
Jan 26, 2012
Messages
169
Im looking for a VBA code that works like Vlookup.
Lookup data= A:B
(D1) is a dropdown list of A:A
(E1) is a manual input of a number.
When the Macro is ran, I want it to search for (D1) in column A:A and increase the amount in the corresponding B:B column by the amount in (E1).

ABCDE
Bronze12Gold3
Silver6
Gold10
Platinum4

<tbody>
</tbody>
 
Last edited:

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Hi
What about
Code:
Sub TEST()
    With Range("A1:B4")
        For Each C In Range("A1:A4")
            If C = Range("d1") Then
                C.Offset(, 1) = C.Offset(, 1) + Range("e1").Value
            End If
        Next C
    End With
End Sub
 
Last edited:
Upvote 0
You are very well come and thank you for the feedback
Be happy
 
Upvote 0
Code:
Sub TEST()
        For Each C In [A1:B4]
            If C = [D1] Then
                C.Offset(, 1) = C.Offset(, 1) + [E1].Value
            End If
        Next C
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,397
Messages
6,119,273
Members
448,883
Latest member
fyfe54

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