max_max
Board Regular
- Joined
- Jun 29, 2013
- Messages
- 58
Good morning to all,
I hope to explain why my English .....
In the attached macro cell by inserting the letters are colored.
In the workbook there are colored stripes in yellow.
The problem is a letter canceling the cell must go yellow.
A greeting.
xam_xam
-----------------------------------------------------------------------------------------
Buongiorno a tutti,
spero di spiegarmi perchè il mio inglese.....
Nella macro allegata inserendo delle lettere la cella si colorano.
Nel workbook ci sono delle righe colorate in giallo.
Il problema è cancellando una lettera la cella deve tornare gialla.
Un saluto.
xam_xam
I hope to explain why my English .....
In the attached macro cell by inserting the letters are colored.
In the workbook there are colored stripes in yellow.
The problem is a letter canceling the cell must go yellow.
A greeting.
xam_xam
-----------------------------------------------------------------------------------------
Buongiorno a tutti,
spero di spiegarmi perchè il mio inglese.....
Nella macro allegata inserendo delle lettere la cella si colorano.
Nel workbook ci sono delle righe colorate in giallo.
Il problema è cancellando una lettera la cella deve tornare gialla.
Un saluto.
xam_xam
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Rng As Range
Dim Rng2 As Range
Dim rCell As Range
Set Rng = Range("E4:AI39") '<<=== da CAMBIARE
Set Rng2 = Intersect(Rng, Target)
If Not Rng2 Is Nothing Then
For Each rCell In Rng2.Cells
With rCell
Select Case LCase(.Value)
Case Is = "a"
.Interior.ColorIndex = 3
Case Is = "b"
.Interior.ColorIndex = 6
Case Is = "c"
.Interior.ColorIndex = 8
Case Is = "d"
.Interior.ColorIndex = 4
Case Is = "e"
.Interior.ColorIndex = 5
Case Is = "f"
.Interior.ColorIndex = 28
Case Is = "g"
.Interior.ColorIndex = 14
Case Is = "h"
.Interior.ColorIndex = 12
Case Is = "i"
.Interior.ColorIndex = 33
Case Is = "j"
.Interior.ColorIndex = 18
Case Is = "k"
.Interior.ColorIndex = 41
Case Is = "l"
.Interior.ColorIndex = 42
Case Is = "m"
.Interior.ColorIndex = 12
Case Is = "n"
.Interior.ColorIndex = 11
Case Is = "o"
.Interior.ColorIndex = 6
Case Is = "p"
.Interior.ColorIndex = 28
Case Is = "q"
.Interior.ColorIndex = 35
Case Is = "r"
.Interior.ColorIndex = 49
Case Is = "s"
.Interior.ColorIndex = 16
Case Is = "t"
.Interior.ColorIndex = 15
Case Is = "u"
.Interior.ColorIndex = 45
Case Is = "v"
.Interior.ColorIndex = 52
Case Is = "w"
.Interior.ColorIndex = 54
Case Is = "x"
.Interior.ColorIndex = 50
Case Is = "y"
.Interior.ColorIndex = 49
Case Is = "z"
.Interior.ColorIndex = 5
Case Else
.Interior.ColorIndex = xlNone
End Select
End With
Next rCell
End If
If Intersect(Target, Range("E4:AI39")) Is Nothing Then Exit Sub
On Error Resume Next
Application.EnableEvents = False
Target = UCase(Target)
Application.EnableEvents = True
End Sub