Results 1 to 15 of 15

Thread: Solved: Click to color

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Try this, included in the sheet's code (not in workbook's code, not in a module):
    Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
    Select Case Target.Address
    Case "$A$1"
      Target.Interior.Color = RGB(255, 0, 0)
      Range("B1").Interior.Color = RGB(255, 255, 255)
      Range("C1").Interior.Color = RGB(255, 255, 255)
    Case "$B$1"
      Target.Interior.Color = RGB(255, 127, 0)
      Range("A1").Interior.Color = RGB(255, 255, 255)
      Range("C1").Interior.Color = RGB(255, 255, 255)
    Case "$C$1"
      Target.Interior.Color = RGB(0, 255, 0)
      Range("A1").Interior.Color = RGB(255, 255, 255)
      Range("B1").Interior.Color = RGB(255, 255, 255)
    End Select
    End Sub
    Last edited by Aussiebear; 03-20-2023 at 04:07 AM. Reason: Adjusted code tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •