Hello,
I have a VBA that I've been using for a while.
I would like to add multiple values where I have
If Target.Offset(0, -1).Value = "Running Repair" Then
I have tried
If Target.Offset(0, -1).Value = "Running Repair" Or Target.Offset(0, -1).Value = "Vendor Support" Then
but its not working
What am I doing wrong?
Thank you
I have a VBA that I've been using for a while.
I would like to add multiple values where I have
If Target.Offset(0, -1).Value = "Running Repair" Then
I have tried
If Target.Offset(0, -1).Value = "Running Repair" Or Target.Offset(0, -1).Value = "Vendor Support" Then
but its not working
What am I doing wrong?
Thank you
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim f As Range
Dim resp As VbMsgBoxResult
Dim i As Long
'Running Repair
If Not Intersect(Target, Range("F:F")) Is Nothing Then
If Target.Count > 1 Then Exit Sub
If Target.Value = "Completed" Then
If Target.Offset(0, -1).Value = "Running Repair" Then
resp = MsgBox("Is unit returned to service?", _
vbYesNo + vbQuestion)
If resp = vbYes Then
Set f = Range("I:J").Find("RETURNED TO SERVICE", , xlValues, xlPart, , , False)
If Not f Is Nothing Then
i = f.Row + 2
Set f = Range("I:J").Find(Range("A" & Target.Row).Value, , xlValues, xlWhole, , , False)
If Not f Is Nothing Then
MsgBox "This unit already exists in the section."
Exit Sub
End If
Do While True
If Range("I" & i).Value = "" Then
Range("I" & i).Value = Range("A" & Target.Row).Value
Exit Do
End If
i = i + 1
Loop
End If
End If
End If
End If
End If