Hi,
Hope somebody can help, I have the below code but I need help making a few changes. At the moment it -1 if the status is set to "used" and +1 if changed to "returned". However, I would now like it to also look at column 12 (L) for a second status. If column 12 is set to "damaged" or "faulty" I would like it to -1. The other problem is that if I select "used" or "returned" and then select the same status again it changes the value again. So, if i select "used" it will deduct one and then if I select it again my mistake it will deduct another one.
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Column = 11 Then
Cancel = True
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count = 1 And Target.Column = 11 Then
mystring = Range("A" & Target.Row) & Range("C" & Target.Row) & Range("E" & Target.Row) & Range("F" & Target.Row)
With Sheets("PartsMaster")
lr = .Cells(.Rows.Count, 1).End(xlUp).Row
ReDim arr(1 To lr)
For x = 1 To lr
arr(x) = .Range("A" & x) & .Range("C" & x) & .Range("E" & x) & Range("F" & Target.Row)
If arr(x) = mystring Then
myrow = x
If Target = "Returned" Then .Cells(myrow, 7) = .Cells(myrow, 7) + 1
If Target = "Used" Then .Cells(myrow, 7) = .Cells(myrow, 7) - 1
Exit For
End If
Next
End With
End If
End Sub
Hope this makes sense.
Cheers
Bookmarks