slayer1957
Board Regular
- Joined
- Jan 9, 2017
- Messages
- 50
Good day, I have a userform with 4x comboboxes,
First box, Equipment type
Second box, Unit
Third box, Equipment number
Fourth box, Spares selection
List should be dynamic, Equipment types, VSD, UPS, Battery Charger and be able to add more in first column of the sheet
List should be dynamic, 1,2,3,4,5 and be able to add more in second column of the sheet
Third box should filter according to the equipment number. It must check the corresponding column heading for instance VSD list, 1-VSD1,2-VSD2,3-VSD3 and filter according to the Unit number and display only the equipment VSDs in the corresponding unit
Fourth box should show the spares list, Driver board, Electronic main board etc. allocated to the selected VSD equipment number in the unit.
All lists must be dynamic
This is what i got from another source, Dynamic mutli level drop down but it i do not know coding well. Could someone please assist.
First box, Equipment type
Second box, Unit
Third box, Equipment number
Fourth box, Spares selection
List should be dynamic, Equipment types, VSD, UPS, Battery Charger and be able to add more in first column of the sheet
List should be dynamic, 1,2,3,4,5 and be able to add more in second column of the sheet
Third box should filter according to the equipment number. It must check the corresponding column heading for instance VSD list, 1-VSD1,2-VSD2,3-VSD3 and filter according to the Unit number and display only the equipment VSDs in the corresponding unit
Fourth box should show the spares list, Driver board, Electronic main board etc. allocated to the selected VSD equipment number in the unit.
All lists must be dynamic
VBA Code:
Option Explicit
Private Sub ComboBox3_Change()
End Sub
Private Sub UserForm_Activate()
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("Combobox")
Dim i As Integer
Me.ComboBox1.Clear
For i = 1 To Application.CountA(sh.Range("1:1"))
Me.ComboBox1.AddItem sh.Cells(1, i).Value
Next i
End Sub
Private Sub ComboBox1_Change()
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("Combobox")
Dim i, n As Integer
Me.ComboBox2.Clear
n = Application.WorksheetFunction.Match(Me.ComboBox1.Value, sh.Range("1:1"), 0)
For i = 2 To Application.WorksheetFunction.CountA(sh.Cells(1, n).EntireColumn)
Me.ComboBox2.AddItem sh.Cells(i, n).Value
Next i
Me.ComboBox2.ListRows = 20
End Sub
Private Sub ComboBox2_Change()
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("Combobox")
Dim i, n As Integer
Me.ComboBox3.Clear
n = Application.WorksheetFunction.Match(Me.ComboBox1.Value, sh.Range("1:2"), 0)
For i = 3 To Application.WorksheetFunction.CountA(sh.Cells(1, n).EntireColumn)
Me.ComboBox3.AddItem sh.Cells(i, n).Value
Next i
Me.ComboBox3.ListRows = 20
End Sub
This is what i got from another source, Dynamic mutli level drop down but it i do not know coding well. Could someone please assist.