I am looking to use the RGB values for a specific color (other than those in the 56 color palette) I have tried just using:
Case 45=Target.Interior.Color= RGB(102, 102, 255)
Case RGB(102, 102, 255= Target.Interior.Color= RGB(255, 255, 51)
But when i do this it reaches the first RGB and locks up the cell where i am unable to click colors forward or backward. Help would be appreciated
Below is what I have created thus far: (This code works butonly with the color index. Need to use RGB values for more color variation)
Case 45=Target.Interior.Color= RGB(102, 102, 255)
Case RGB(102, 102, 255= Target.Interior.Color= RGB(255, 255, 51)
But when i do this it reaches the first RGB and locks up the cell where i am unable to click colors forward or backward. Help would be appreciated
Below is what I have created thus far: (This code works butonly with the color index. Need to use RGB values for more color variation)
Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Intersect(Target, Range("AA1:AB10")) Is Nothing Then
Cancel = True
Select Case Target.Interior.ColorIndex
Case xlnone: Target.Interior.ColorIndex = 56
Case 56: Target.Interior.ColorIndex = 13
Case 13: Target.Interior.ColorIndex = 6
Case 6: Target.Interior.ColorIndex = 44
Case 44: Target.Interior.ColorIndex = 8
Case 8: Target.Interior.ColorIndex = 5
Case 5: Target.Interior.ColorIndex = 4
Case 4: Target.Interior.ColorIndex = 10
End Select
End If
End Sub
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
If Not Intersect(Target, Range("AA1:AB10")) Is Nothing Then
Cancel = True
Select Case Target.Interior.ColorIndex
Case 10: Target.Interior.ColorIndex = 4
Case 4: Target.Interior.ColorIndex = 5
Case 5: Target.Interior.ColorIndex = 8
Case 8: Target.Interior.ColorIndex = 44
Case 44: Target.Interior.ColorIndex = 6
Case 6: Target.Interior.ColorIndex = 13
Case 13: Target.Interior.ColorIndex = 7
Case 7: Target.Interior.ColorIndex = xlnone
End Select
End If
End Sub
Last edited by a moderator: