I am trying to do dependent drop down in excel vba
Range("Q2").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=INDIRECT(M2)"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End sub
I want to apply it for rows until which column L is having data(if data in column L is upto 50th row, dependent drop down must be applied until 50th row of column Q
The code im currently using gives a application defined error, It would be a great help if someone helps me out.
Range("Q2").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=INDIRECT(M2)"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End sub
I want to apply it for rows until which column L is having data(if data in column L is upto 50th row, dependent drop down must be applied until 50th row of column Q
The code im currently using gives a application defined error, It would be a great help if someone helps me out.