Hello,
I'm trying to write code that will check if the cell values have changed in a given range, and if so check if the value is in a list. If it´s not on the list it should open up a form to enter the new suppliers information.
I'm running into a problem trying to match the value entered in the cell to the list. the error i get is "Run-time error 1004: Unable to get the Match property of the WorksheetFunction class".
Code follows. Any help is appreciated.
I'm trying to write code that will check if the cell values have changed in a given range, and if so check if the value is in a list. If it´s not on the list it should open up a form to enter the new suppliers information.
I'm running into a problem trying to match the value entered in the cell to the list. the error i get is "Run-time error 1004: Unable to get the Match property of the WorksheetFunction class".
Code follows. Any help is appreciated.
VBA Code:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range) 'Excel VBA with more cells in the range.
If Not Intersect(Target, Range("Proveedores_Input")) Is Nothing Then
If WorksheetFunction.Match(Target.Value, Sheets("Proveedores").Range("C5:C1000000"), 0) Then
' If WorksheetFunction.Match(Target.Value, Sheets("Proveedores").Range("Proveedores_Lista"), 0) Then
MsgBox Target.Value & " - Matched"
End If
End If
End Sub