Hi Excel forum users!
I have the following code:
If Range("M10:M" & Cells(Rows.Count, 2).End(xlUp).Row).Value = "mom" Then
Sheets("Sheet2").Range("L10:L" & Cells(Rows.Count, 2).End(xlUp).Row).ClearContents
Sheets("Sheet2").Range("L10:L" & Cells(Rows.Count, 2).End(xlUp).Row).Select
Set rng = Range(("L10:L" & Cells(Rows.Count, 2).End(xlUp).Row))
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:="=Sheet6!$A$1:$A$18"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
Else
Range("M10:M" & Cells(Rows.Count, 2).End(xlUp).Row).Value = "dad"
Sheets("Sheet2").Range("L10:L" & Cells(Rows.Count, 2).End(xlUp).Row).ClearContents
Sheets("Sheet2").Range("L10:L" & Cells(Rows.Count, 2).End(xlUp).Row).Select
Set rng = Range(("L10:L" & Cells(Rows.Count, 2).End(xlUp).Row))
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:="=Sheet6!$A$19:$A$29"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End If
In the Columns M10:M I have 2 values: "MOM" and "DAD"
I try to use to fill with xlValidateList depending the values, but say me in excel erro that "Error: 13: "type MISTMATCH"
Please help!
Best Regards!!
Bookmarks