I need when a user selects an option from the dropdown menu, it will trigger the event and lock down certain range of cells. I got the codes for lockdown cell but I can\'t l
an example can be found here with named ranges:
http://www.sebastianviereck.de/en/VBA-dropdown-change-event-to-perform-action/
If you're using a data validation dropdown, you can use the Worksheet_Change event like so:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
With Application
.EnableEvents = False
.ScreenUpdating = False
.Calculation = xlCalculationManual
End With
' Code to lock ranges goes here
With Application
.EnableEvents = True
.ScreenUpdating = True
.Calculation = xlCalculationAutomatic
End With
End If
End Sub
This assumes that your data validation is in cell A1. You'll have to update the reference as appropriate for your situation.