Dazzawm
Well-known Member
- Joined
- Jan 24, 2011
- Messages
- 3,786
- Office Version
- 365
- Platform
- Windows
I was given the code below so that when I enter the letters anywhere on the worksheet it colours them in. I have changed the spreadsheet around so it is running vertical rather than horizontally, but it doesn't work now and I thought it should make no difference! Help please!
The range now would be C4:CB316
The range now would be C4:CB316
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim intclr As Integer
If Application.Intersect(Range("A1"), Range("h15")) Is Nothing Then
If Target.count > 1 Then Exit Sub
Select Case Target
Case "T"
intclr = 40
Case "Y"
intclr = 36
Case "C"
intclr = 35
Case "S1" To "S8"
intclr = 37
Case "O" To "o"
intclr = 43
Case "L1" To "L8"
intclr = 42
Case Else
End Select
Target.Interior.ColorIndex = intclr
End If
End Sub