Hi
I need to use the code below to attach a data validation list to columns K, L and M. The only thing is the row for each sheet is different hence the use of Activecell. The code I have is:
The problem is once it has finished with the first selection it does not move onto the next column but highlights both columns K and L. I have different lists for each column. How can I change the code so that after the first data validation has applied it moves on to column L and then to column M?
Thanks
Fazila
I need to use the code below to attach a data validation list to columns K, L and M. The only thing is the row for each sheet is different hence the use of Activecell. The code I have is:
Code:
Sub IntList()'
' IntList Macro
'
Range(ActiveCell.Offset(1, 0), ActiveCell.End(xlDown)).Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=Lookups!$B$2:$B$8"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
Range(ActiveCell.Offset(0, 1), ActiveCell.End(xlDown)).Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=Lookups!$A$2:$A$8"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
Range(ActiveCell.Offset(0, 2), ActiveCell.End(xlDown)).Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=Lookups!$C$2:$C$8"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End Sub
The problem is once it has finished with the first selection it does not move onto the next column but highlights both columns K and L. I have different lists for each column. How can I change the code so that after the first data validation has applied it moves on to column L and then to column M?
Thanks
Fazila