Hello All,
I've utilized these forums for some time now and have found them extremely helpful, however this is the first time I am posting a questions. I'd like to say thank you to anyone that has helped anyone out though, because helping one person probably helps 10x or 20x more people that read the post.
Now on to my issue... I am utilizing VBA to create two columns worth of validations. The first column (G) is created off of a named range "SC1_List", which has the following options {Security, Loan, Deposit, Borrowing}. I want the second column to be dependent based on the selection of the first column for the corresponding row (i.e. h2 dependent on g2, etc.), so I have four named ranges set up, as "SC2_List_Security", "SC2_List_Loan", etc. In VBA, I am using the following code to create the validation:
I am getting an error 1004 application-defined or object defined error and I am not sure why.
I appreciate any help in advance. Thanks all.
I've utilized these forums for some time now and have found them extremely helpful, however this is the first time I am posting a questions. I'd like to say thank you to anyone that has helped anyone out though, because helping one person probably helps 10x or 20x more people that read the post.
Now on to my issue... I am utilizing VBA to create two columns worth of validations. The first column (G) is created off of a named range "SC1_List", which has the following options {Security, Loan, Deposit, Borrowing}. I want the second column to be dependent based on the selection of the first column for the corresponding row (i.e. h2 dependent on g2, etc.), so I have four named ranges set up, as "SC2_List_Security", "SC2_List_Loan", etc. In VBA, I am using the following code to create the validation:
HTML:
'Set SC1 Validation
ActiveCell.Offset(0, 6).Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:="=SC1_List"
End With
'Set SC2 Validation
ActiveCell.Offset(0, 1).Select
'Create text string for dependend validation formula
strValidation = "=indirect(concatenate(""SC2_List_"",G" & i + 1 & "))"
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:=strValidation
End With
I am getting an error 1004 application-defined or object defined error and I am not sure why.
I appreciate any help in advance. Thanks all.