ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,731
- Office Version
- 2007
- Platform
- Windows
Im trying with the code below to look in column C for the value VA2 BLADE & return the row number,depending on if i select Yes or No depends if code stops or clooks for next instance.
My error is the code in Red
My error is the code in Red
Rich (BB code):
Private Sub VA2_Click()
Dim myRange As Range
Set myRange = Range("Table23").ListObject.DataBodyRange
For Each myCell In Intersect(Columns("C"), myRange)
If Value = ("VA2 BLADE") (myCell) Then
With Range("A" & myCell.Row)
If MsgBox("VA2 FOUND AT ROW: " & myCell.Address(0, 0) & vbCr & vbCr & _
"THE CUSTOMER IS : " & .Value & vbCr & vbCr & _
"IS THIS THE CUSTOMER YOU ARE LOOKING FOR ?", vbCritical + vbYesNo, "CUSTOMER INVOICE SEARCH") = vbYes Then
.Select
Exit Sub
End If
End With
End If
Next myCell
MsgBox "THERE ARE NO MORE" & vbNewLine & vbNewLine & "SO THE SEARCH IS NOW COMPLETE", vbInformation, "VA2 SEARCH MESSAGEE"
Range("A5").Select
End Sub