Answer to this Thread post:
https://excelfox.com/forum/showthrea...ll=1#post14873
Code:Private Sub Worksheet_Change(ByVal Target As Range) ' https://excelfox.com/forum/showthread.php/2624-Drop-Down-Menu-with-Multiple-Conditions?p=14873&viewfull=1#post14873 If Target.Address = "$J$19" Or Target.Address = "$J$19:$P$19" Then ' we need "$J$19:$P$19" to make macro work on Delete probably because of merged cells Dim RngTgt As Range: Set RngTgt = Target If Target.Address = "$J$19:$P$19" Then Set RngTgt = Range("J19") If RngTgt.Value = "" Then Let Application.EnableEvents = False Let RngTgt.Value = "(Select Here)" Let Application.EnableEvents = True Let RngTgt.Font.Color = 10855845 ElseIf RngTgt.Value = "Nuclear Family" Or RngTgt.Value = "Joint Family" Then Let Application.EnableEvents = False Let Range("R19").Value = "(Remark if any)" Let Application.EnableEvents = True Let Range("R19").Font.Color = 10855845 Let RngTgt.Font.Color = 6751362 ElseIf RngTgt.Value = "Single-Parent Family" Then Let Application.EnableEvents = False Let Range("R19").Value = "(Select Reason)" Let Application.EnableEvents = True Let Range("R19").Font.Color = 10855845 Let RngTgt.Font.Color = 6751362 ElseIf RngTgt.Value = "Uncategorised" Then Let Application.EnableEvents = False Let Range("R19").Value = "(Please Specify the Case)" Let Application.EnableEvents = True Let Range("R19").Font.Color = 10855845 Let RngTgt.Font.Color = 6751362 End If Else ' Target is Not a cell to be acted on End If If Target.Address = "$R$19" Then Let Target.Font.ColorIndex = xlAutomatic End Sub




Reply With Quote
Bookmarks