command button = clmClear
first combobox = AreaBox
second combobox = RoomBox
Private Sub AreaBox_Change()
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("data")
Dim i As Integer
Dim n As Integer
n = Application.WorksheetFunction.Match(Me.AreaBox.Value, sh.Range("A1:H1"), 0)
Me.RoomBox.Clear
For i = 2 To Application.WorksheetFunction.CountA(sh.Cells(1, n).EntireColumn)
Me.RoomBox.AddItem sh.Cells(i, n).Value
Next i
End Sub
Private Sub cmbClear_Click()
Me.AreaBox = ""
Me.RoomBox = ""
End Sub
(help it reset the Room box but not Area and it gives me an error)
first combobox = AreaBox
second combobox = RoomBox
Private Sub AreaBox_Change()
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("data")
Dim i As Integer
Dim n As Integer
n = Application.WorksheetFunction.Match(Me.AreaBox.Value, sh.Range("A1:H1"), 0)
Me.RoomBox.Clear
For i = 2 To Application.WorksheetFunction.CountA(sh.Cells(1, n).EntireColumn)
Me.RoomBox.AddItem sh.Cells(i, n).Value
Next i
End Sub
Private Sub cmbClear_Click()
Me.AreaBox = ""
Me.RoomBox = ""
End Sub
(help it reset the Room box but not Area and it gives me an error)