BlessedN2N
New Member
- Joined
- Feb 9, 2018
- Messages
- 2
I'm changing the background color of cells from black to green when clicked once. I can change the background cell colors from green to black when I right click.
Is there a way to create a Reset button that will change all the changed cell colors back to black from green when clicked instead of having to right click every cell individually or clearing all information from the cells. I found a reset button feature but it cleared all of the information instead of only changing the color back to black from green.
This is what i'm using
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
Select Case Target.Interior.ColorIndex
Case xlNone, 4: Target.Interior.ColorIndex = 4
Case Else: Target.Interior.ColorIndex = 4
End Select
End Sub
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
Target.Interior.Color = vbBlack
End Sub
Is there a way to create a Reset button that will change all the changed cell colors back to black from green when clicked instead of having to right click every cell individually or clearing all information from the cells. I found a reset button feature but it cleared all of the information instead of only changing the color back to black from green.
This is what i'm using
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
Select Case Target.Interior.ColorIndex
Case xlNone, 4: Target.Interior.ColorIndex = 4
Case Else: Target.Interior.ColorIndex = 4
End Select
End Sub
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
Target.Interior.Color = vbBlack
End Sub