samedi 27 mars 2021

If statement with Match function in vba

I'm working on collection database, that can be used for sport cards. I'm nearly done with everything, but I have a problem with Match function in VBA. I tried to combine it with If statement, but if the Match function does not giving back a result, then the macro stops. Here is this part of the code:

Dim shortnamee As Integer
Dim ittkeres As Range
    Set ittkeres = Range("X:X") 
    shortnamee = WorksheetFunction.Match(Range("V2"), ittkeres, 0)
    Range("V3") = shortnamee
    If Range("V3").Value > 0 Then

This part connects to the first page, where I can add new items to the collection sheets, and here it looks for duplicates from a concatenated name (V2 - the new items name; X:X - where the rest of the collection is, already uploaded. Thanks a lot!

Aucun commentaire:

Enregistrer un commentaire