Hi all, the below macro has been working fine for years and is not working anymore since today. I am on a Mac.
It blocks each time it tries going through the "=RGB" functions such as the following, which returns Run-time error 5 "Invalid procedure, call or argument".
ElseIf Target.Interior.Color = RGB(255, 94, 94)
Can anyone please help?
---
---
Thanks.
It blocks each time it tries going through the "=RGB" functions such as the following, which returns Run-time error 5 "Invalid procedure, call or argument".
ElseIf Target.Interior.Color = RGB(255, 94, 94)
Can anyone please help?
---
VBA Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Column = Range("Inventory_ID").Column Then
If Target.Interior.Color = 16777215 Then
Range(Target, Range("Inventory_Note").Offset(Target.Row - Range("Inventory_ID").Row)).Interior.Color = RGB(255, 94, 94)
Range("Inventory_Available").Offset(Target.Row - Range("Inventory_ID").Row) = "N"
ElseIf Target.Interior.Color = RGB(255, 94, 94) Then
Range(Range("Inventory_ID").Offset(Target.Row - Range("Inventory_ID").Row), Range("Inventory_Note").Offset(Target.Row - Range("Inventory_ID").Row)).Interior.Color = RGB(255, 204, 153)
Range("Inventory_Available").Offset(Target.Row - Range("Inventory_ID").Row) = "N"
ElseIf Target.Interior.Color = RGB(255, 204, 153) Then
Range(Range("Inventory_ID").Offset(Target.Row - Range("Inventory_ID").Row), Range("Inventory_Note").Offset(Target.Row - Range("Inventory_ID").Row)).Interior.Color = xlNone
Range("Inventory_Available").Offset(Target.Row - Range("Inventory_ID").Row) = "Y"
'ElseIf Target.Interior.Color = RGB(255, 127, 0) Then
' Range(Range("Inventory_ID").Offset(Target.Row - Range("Inventory_ID").Row), Range("Inventory_Note").Offset(Target.Row - Range("Inventory_ID").Row)).Interior.Color = RGB(150, 131, 236)
'ElseIf Target.Interior.Color = RGB(150, 131, 236) Then
' Range(Range("Inventory_ID").Offset(Target.Row - Range("Inventory_ID").Row), Range("Inventory_Note").Offset(Target.Row - Range("Inventory_ID").Row)).Interior.Color = xlNone
End If
ElseIf (Target.Column = Range("Inventory_Online").Column Or Target.Column = Range("Inventory_Signed").Column Or Target.Column = Range("Inventory_COA").Column Or Target.Column = Range("Inventory_Framed").Column Or Target.Column = Range("Inventory_Buy_Invoice").Column) And Target.Row > Range("Inventory_Online").Row And Target.Row <= Range("Inventory_ID").End(xlDown).Row Then
If Target.Value = "Y" Then
Target.Value = "N"
ElseIf Target.Value = "N" Then
Target.Value = "Y"
Else:
Target.Value = "N"
End If
End If
Cancel = True
End Sub
---
Thanks.