Eric Carolus
Board Regular
- Joined
- Sep 17, 2012
- Messages
- 128
- Office Version
- 2016
- Platform
- Windows
Good day Folks
I have searched the forum, but none of the posts address my issue.
I wish to populate a combo box via vba , based on two prior selections. this what I have done so far:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Worksheets("Sheet1").Range("M8").Value = "Day 1" Then
Dim i As Integer
Dim cell As Range
Dim periodrange As Range
Set periodrange = Worksheets("Sheet1").Range("C7:C27")
For Each cell In periodrange
'This is where I do not know how code further.
'What I want to do though is if the user Select, say, Day 1
'then in C7:C26 there may appear, for example, Admin, Break, Period 1, Period 2, Period 3, etc.
' Only in the corresponding range F7:F26 a data validation combo should appear
'with the data of the corresponding names of people.
'Differently said, if (in C7:C26), say the value of C8 is Period 1, them in F8 a combo should
'appear with the names of D1P1, opposite Period 2 Should appear the names in D1P2.
' Is this even possible?
'Is there a better way of doing this?
'Please help
Next cell
End If
End Sub
I really need all the help I can get.
Thanks in advance.
Eric
Ps. I inclued the workbook CombosHelp.xlsm
I have searched the forum, but none of the posts address my issue.
I wish to populate a combo box via vba , based on two prior selections. this what I have done so far:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Worksheets("Sheet1").Range("M8").Value = "Day 1" Then
Dim i As Integer
Dim cell As Range
Dim periodrange As Range
Set periodrange = Worksheets("Sheet1").Range("C7:C27")
For Each cell In periodrange
'This is where I do not know how code further.
'What I want to do though is if the user Select, say, Day 1
'then in C7:C26 there may appear, for example, Admin, Break, Period 1, Period 2, Period 3, etc.
' Only in the corresponding range F7:F26 a data validation combo should appear
'with the data of the corresponding names of people.
'Differently said, if (in C7:C26), say the value of C8 is Period 1, them in F8 a combo should
'appear with the names of D1P1, opposite Period 2 Should appear the names in D1P2.
' Is this even possible?
'Is there a better way of doing this?
'Please help
Next cell
End If
End Sub
I really need all the help I can get.
Thanks in advance.
Eric
Ps. I inclued the workbook CombosHelp.xlsm