In support of this Post
https://excelfox.com/forum/showthrea...5110#post15110
Code:
Sub MakeNormalDropDowns2x4() ' https://excelfox.com/forum/showthread.php/2676-Dependent-Drop-Down-Lists?p=15110&viewfull=1#post15110
Rem 1 worksheets info
Dim WsApp As Worksheet, WsComs As Worksheet, WsActual As Worksheet
Set WsApp = ThisWorkbook.Worksheets("Appraisal"): Set WsComs = ThisWorkbook.Worksheets("Comments"): Set WsActual = ThisWorkbook.Worksheets("Actual Appraisal Form")
Rem FirstTwoDropDowns
Rem 2 SOCIAL COMPETENCIES
'2a) Topic SOCIAL COMPETENCIES List 1 in column A
WsActual.Range("A26:A27").Validation.Delete
WsActual.Range("A26:A27").Validation.Add Type:=xlValidateList, Formula1:="" & WsComs.Range("A1").Value & "," & WsComs.Range("A11").Value & "," & WsComs.Range("A21").Value & "," & WsComs.Range("A31").Value & ""
'2b) Please Choose List 2 in column C
WsActual.Range("C26:C27").Validation.Delete
WsActual.Range("C26:C27").Validation.Add Type:=xlValidateList, Formula1:="" & WsComs.Range("A2").Value & "," & WsComs.Range("B2").Value & "," & WsComs.Range("C2").Value & ""
Rem 3 PERSONAL COMPETENCIES
'3a) Topic PERSONAL COMPETENCIES List 1 in column A
WsActual.Range("A29:A30").Validation.Delete
WsActual.Range("A29:A30").Validation.Add Type:=xlValidateList, Formula1:="" & WsComs.Range("A41").Value & "," & WsComs.Range("A51").Value & "," & WsComs.Range("A61").Value & "," & WsComs.Range("A71").Value & "," & WsComs.Range("A81").Value & "," & WsComs.Range("A91").Value & ""
'3b) Please Choose List 2 in column C
WsActual.Range("C29:C30").Validation.Delete
WsActual.Range("C29:C30").Validation.Add Type:=xlValidateList, Formula1:="" & WsComs.Range("A2").Value & "," & WsComs.Range("B2").Value & "," & WsComs.Range("C2").Value & ""
Rem 4 METHODOLOGICAL COMPETENCIES
'4a) Topic METHODOLOGICAL COMPETENCIES List 1 in column A
WsActual.Range("A32:A33").Validation.Delete
WsActual.Range("A32:A33").Validation.Add Type:=xlValidateList, Formula1:="" & WsComs.Range("A111").Value & "," & WsComs.Range("A121").Value & "," & WsComs.Range("A131").Value & ""
'4b) Please Choose List 2 in column C
WsActual.Range("C32:C33").Validation.Delete
WsActual.Range("C32:C33").Validation.Add Type:=xlValidateList, Formula1:="" & WsComs.Range("A2").Value & "," & WsComs.Range("B2").Value & "," & WsComs.Range("C2").Value & ""
Rem 5 LEADERSHIP COMPETENCIES
'5a) Topic LEADERSHIP COMPETENCIES List 1 in column A
WsActual.Range("A35:A36").Validation.Delete
WsActual.Range("A35:A36").Validation.Add Type:=xlValidateList, Formula1:="" & WsComs.Range("A141").Value & "," & WsComs.Range("A151").Value & "," & WsComs.Range("A161").Value & "," & WsComs.Range("A171").Value & "," & WsComs.Range("A181").Value & "," & WsComs.Range("A191").Value & ""
'5b) Please Choose List 2 in column C
WsActual.Range("C35:C36").Validation.Delete
WsActual.Range("C35:C36").Validation.Add Type:=xlValidateList, Formula1:="" & WsComs.Range("A2").Value & "," & WsComs.Range("B2").Value & "," & WsComs.Range("C2").Value & ""
End Sub
Code:
Sub MakeNormalDropDowns1x4andLoop4times() ' https://excelfox.com/forum/showthread.php/2561-Appendix-Thread-(-Codes-for-other-Threads-etc-)-Event-Coding-Drpdown-Data-validation?p=15111&viewfull=1#post15111 https://excelfox.com/forum/showthread.php/2676-Dependent-Drop-Down-Lists?p=15110&viewfull=1#post15110
Rem 1 worksheets info
Dim WsApp As Worksheet, WsComs As Worksheet, WsActual As Worksheet
Set WsApp = ThisWorkbook.Worksheets("Appraisal"): Set WsComs = ThisWorkbook.Worksheets("Comments"): Set WsActual = ThisWorkbook.Worksheets("Actual Appraisal Form")
Rem FirstTwoDropDowns
Rem 2 SOCIAL COMPETENCIES
'2a) Topic SOCIAL COMPETENCIES List 1 in column A
WsActual.Range("A26:A27").Validation.Delete
WsActual.Range("A26:A27").Validation.Add Type:=xlValidateList, Formula1:="" & WsComs.Range("A1").Value & "," & WsComs.Range("A11").Value & "," & WsComs.Range("A21").Value & "," & WsComs.Range("A31").Value & ""
Rem 3 PERSONAL COMPETENCIES
'3a) Topic PERSONAL COMPETENCIES List 1 in column A
WsActual.Range("A29:A30").Validation.Delete
WsActual.Range("A29:A30").Validation.Add Type:=xlValidateList, Formula1:="" & WsComs.Range("A41").Value & "," & WsComs.Range("A51").Value & "," & WsComs.Range("A61").Value & "," & WsComs.Range("A71").Value & "," & WsComs.Range("A81").Value & "," & WsComs.Range("A91").Value & ""
Rem 4 METHODOLOGICAL COMPETENCIES
'4a) Topic METHODOLOGICAL COMPETENCIES List 1 in column A
WsActual.Range("A32:A33").Validation.Delete
WsActual.Range("A32:A33").Validation.Add Type:=xlValidateList, Formula1:="" & WsComs.Range("A111").Value & "," & WsComs.Range("A121").Value & "," & WsComs.Range("A131").Value & ""
Rem 5 LEADERSHIP COMPETENCIES
'5a) Topic LEADERSHIP COMPETENCIES List 1 in column A
WsActual.Range("A35:A36").Validation.Delete
WsActual.Range("A35:A36").Validation.Add Type:=xlValidateList, Formula1:="" & WsComs.Range("A141").Value & "," & WsComs.Range("A151").Value & "," & WsComs.Range("A161").Value & "," & WsComs.Range("A171").Value & "," & WsComs.Range("A181").Value & "," & WsComs.Range("A191").Value & ""
Rem Please Choose - all 4 ranges in a loop
Dim Ofst As Long
For Ofst = 0 To 9 Step 3
WsActual.Range("C26:C27").Offset(RowOffset:=Ofst, ColumnOffset:=0).Validation.Delete
WsActual.Range("C26:C27").Offset(RowOffset:=Ofst, ColumnOffset:=0).Validation.Add Type:=xlValidateList, Formula1:="" & WsComs.Range("A2").Value & "," & WsComs.Range("B2").Value & "," & WsComs.Range("C2").Value & ""
Next Ofst
End Sub
Share 'Appraisal - Drop Down 11 11.xls' : https://app.box.com/s/wj11tpgc9fsuoekp023cd7ndkkqyvtm1
Bookmarks