VBA lookup when not found

blossomthe2nd

Active Member
Joined
Oct 11, 2010
Messages
450
Hi Experts

I hope someone can help - I have a sheet call Paste and one called look up -

On the lookup tab there is a list of accounts (the numbers of which varies perday) in column B - Using VBA I wish to do a vlookup on tab Paste looking in Column B and returning Column Cs value -

I have tried a few Codes that I have found online but in all cases whenever an account is not found the cose just stops rather than moving to next account

Can anyone please advise ?

Thanks

A
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Code:
Dim rngData     As Range
    Dim rngLookup   As Range
    Dim Lookup      As Range
    
    'Set lookup value
    Set rngLookup = Sheets("Results").Range("B2")
    
    'Set range you want to search
    Set rngData = Sheets("Paste R4037").Range("B:B")
    
    For Each Lookup In rngData
        If Lookup.Value = rngLookup.Value Then
            rngLookup.Offset(0, 3) = Lookup.Offset(0, 3)
        End If
    Next Lookup

Hi Guys

The above is what I'm working on - I ned dit to move on even if result isnt found

Thanks

A
 
Upvote 0

Forum statistics

Threads
1,214,590
Messages
6,120,423
Members
448,961
Latest member
nzskater

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