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

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
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,213,494
Messages
6,113,988
Members
448,538
Latest member
alex78

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