Pookiemeister
Well-known Member
- Joined
- Jan 6, 2012
- Messages
- 626
- Office Version
- 365
- 2010
- Platform
- Windows
As of now I have two tabs labeled hats and shoes. The first combo box displays in this case Hats and Shoes.
If the user selects hats from the first combo box, on the spreadsheet with the tab labeled "Hats", starting in cell "A3" starts the list of different types of hats. As the user adds more hats to column A it should be added to the combo box. I thought the below code would work but it displays a "Run-time error '381': Could not set the List property. Invalid property array index."
Thank you to all for your help
Code:
Private Sub cmbSDPFLine_Enter() Dim i As Long
cmbSDPFLine.Clear
cmbPrdCde.Enabled = False
cmbPrdCde.Clear
txtbxPrdctNm.Text = ""
WS_Count = ActiveWorkbook.Worksheets.Count
For i = 5 To WS_Count
cmbSDPFLine.AddItem Sheets(i).Name
Next
End Sub
Code:
Private Sub cmbPrdCde_Enter()
If cmbSDPFLine.Value = "Hats" Then
cmbPrdCde.Clear
cmbPrdCde.Value = ""
With ThisWorkbook.Worksheets("Hats")
Me.cmbPrdCde.List = .Range("A3").End(xlDown)
End With
End SUB