I have written code for the actions to be performed based on dropdown option that you are selecting.
if you select "Yes", the row from Columns B:N will high-light yellow. If you then type something else into any of the Columns B:N in an already high-lighted row(and then click away or Tab or move to another cell), the row color will immediately return to normal. Hence, an event has to happen in a cell for the code to execute. Sharing file which somewhat looks like this and all the columns depend on each other.
Ajo.xlsm
Option Compare Text
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Columns("B:N")) Is Nothing Then Exit Sub
If Target.Count > 1 Then Exit Sub
x = Target.Row
If Target.Value = "Yes" And WorksheetFunction.CountA(Range("C" & x).Resize(, 12)) = 0 Then
Range("C" & x).Resize(, 12).Interior.ColorIndex = 6
ElseIf Target.Value = "No" Then
Range("C" & x).Resize(, 12).Value = "N/A"
End If
If Target.Column <> 2 Then
Target.Interior.ColorIndex = xlNone
End If
End Sub
This code is working perfectly fine in the other sheets but not into my worksheet which has n number merged cells.
Can anybody please help me with this ASAP.
Thanks,
Anu
if you select "Yes", the row from Columns B:N will high-light yellow. If you then type something else into any of the Columns B:N in an already high-lighted row(and then click away or Tab or move to another cell), the row color will immediately return to normal. Hence, an event has to happen in a cell for the code to execute. Sharing file which somewhat looks like this and all the columns depend on each other.
Ajo.xlsm
Option Compare Text
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Columns("B:N")) Is Nothing Then Exit Sub
If Target.Count > 1 Then Exit Sub
x = Target.Row
If Target.Value = "Yes" And WorksheetFunction.CountA(Range("C" & x).Resize(, 12)) = 0 Then
Range("C" & x).Resize(, 12).Interior.ColorIndex = 6
ElseIf Target.Value = "No" Then
Range("C" & x).Resize(, 12).Value = "N/A"
End If
If Target.Column <> 2 Then
Target.Interior.ColorIndex = xlNone
End If
End Sub
This code is working perfectly fine in the other sheets but not into my worksheet which has n number merged cells.
Can anybody please help me with this ASAP.
Thanks,
Anu