Thank for the Macro and explaining everything clearly and systematically!
While working with this Macro, I found
(1) When I select the cell "J19" and press the 'delete' key on my keyboard, the cell value is deleted, but the fade font "(Select)" does not appear in the cell "J19".
However, when I press the backspace key after selecting the cell "J19", "(Select)" appers.
(2) When I select any option from the drop down menu or enter manually any value in the cell "J19", it apperas in the cell in the same faded font, just like "Select". (Solved!)
(3) When I select an option in Cell "J19", say "Nuclear Family", the corresponding value in the cell "R19", for example "(Remark if any)", appears in faded font. That's nice.
But when I type something in the Cell "R19", it appears in the same faded font, just like "(Remarks if any)".
Point (2), here, is solved by me by making a little bit changes in the provided macro. It is here...
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$J$19" Then
If Target.Value = "" Then ' case a cell was emptied
Let Application.EnableEvents = False
Let Target.Value = "(Select Here)"
Let Range("R19").Value = ""
Let Application.EnableEvents = True
With Target.Font
.Color = -3817475
End With
Else ' case a text was entered
With Target.Font
.Color = -12316781
End With
End If
Else ' Target is Not a cell to be acted on
End If
If Target.Address = "$J$19" Then
If Target.Value = "Nuclear Family" Or Target.Value = "Joint Family" Then
Let Application.EnableEvents = False
Let Range("R19").Value = "(Remark if any)"
Let Application.EnableEvents = True
With Range("R19").Font
.Color = 10855845
'.ColorIndex = 48
End With
ElseIf Target.Value = "Single-Parent Family" Then
Let Application.EnableEvents = False
Let Range("R19").Value = "(Select Reason)"
Let Application.EnableEvents = True
With Range("R19").Font
.Color = 10855845
'.ColorIndex = 48
End With
ElseIf Target.Value = "Uncategorised" Then
Let Application.EnableEvents = False
Let Range("R19").Value = "(Please Specify the Case)"
Let Application.EnableEvents = True
With Range("R19").Font
.Color = 10855845
'.ColorIndex = 48
End With
End If
Else
' Target is Not a cell to be acted on
End If
End Sub
But I'm unable to solve the Point (3) issue. And point (1) is beyond my area of 'little" knowledge!
Bookmarks