so, i am not even "new" to vbas, thats how much i know. i just find the codes and try and hope for the best they work. so basically, i have 6 drop down lists, first 3-4 usually contains multiple items, but last 2-3 usually contain 1 but it is not 100% of the time.
on a sheet called "Internal_Page" i created lists (using UNIQUE function with the help of FILTER) and on "Email" sheet i created the dropdowns.
What i managed to do is i found a code to reset contents of a dropdown list (data validation) when the first one is changed, then edited it so if i change 2nd dropdown, 3-4-5-6 resets, if i change 3rd, 4-5-6 resets and so on.
What i am trying to do is, since especially the last 3 (but i would like to have this for them all) usually contains only 1 option for dropdown, i want them to be selected automatically. so "if there is only 1 option show it" or "show the top/bottom/any option from the list" is exactly what i am looking for. can anyone help?
the code i used for clearing the consequent dropdown lists is;
on a sheet called "Internal_Page" i created lists (using UNIQUE function with the help of FILTER) and on "Email" sheet i created the dropdowns.
What i managed to do is i found a code to reset contents of a dropdown list (data validation) when the first one is changed, then edited it so if i change 2nd dropdown, 3-4-5-6 resets, if i change 3rd, 4-5-6 resets and so on.
What i am trying to do is, since especially the last 3 (but i would like to have this for them all) usually contains only 1 option for dropdown, i want them to be selected automatically. so "if there is only 1 option show it" or "show the top/bottom/any option from the list" is exactly what i am looking for. can anyone help?
the code i used for clearing the consequent dropdown lists is;
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$G$6" Then
Range("G7").ClearContents
Range("G8").ClearContents
Range("G9").ClearContents
Range("G10").ClearContents
Range("G11").ClearContents
End If
If Target.Address = "$G$7" Then
Range("G8").ClearContents
Range("G9").ClearContents
Range("G10").ClearContents
Range("G11").ClearContents
End If
If Target.Address = "$G$8" Then
Range("G9").ClearContents
Range("G10").ClearContents
Range("G11").ClearContents
End If
If Target.Address = "$G$9" Then
Range("G10").ClearContents
Range("G11").ClearContents
End If
If Target.Address = "$G$10" Then
Range("G11").ClearContents
End If
End Sub