January 14, 2023
I have a query for Excel VBA actually.
I have a dropdown list in cell A2 of excel sheet like selecting, A, B, C and D, and also have cells E to H in Excel Worksheet, I want logic to work automatically wherein, when user selects anything from A, B, C only. Values in Cells E to H should get cleared off automatically.
I have used VBA code at worksheet level like Worksheet Activate or Selection Change event to do this. But it is creating issues like Continuous screen flickering of that particular worksheet.
November 8, 2013
You should use the Workbook_Change event, with a condition to monitor columns A,B,C, but make sure you disable events, otherwise clearing cells is also triggering the change event:
If Target.Column<4 then
Range("E" & Target.Row & ":H" & Target.Row).ClearContents