gadrummer65
New Member
- Joined
- Mar 6, 2014
- Messages
- 9
Hello,
I have a code that mostly works. The only problem i am having is when the text boxes populate, they always populate the last item in my list, and not what i am clicking on. Any help would be greatly appreciated.
I have a code that mostly works. The only problem i am having is when the text boxes populate, they always populate the last item in my list, and not what i am clicking on. Any help would be greatly appreciated.
Code:
Private Sub ComboBox2_Click()
Dim LR As Long
Dim fRng As Range
With Sheets("Hotels")
LR = .Cells.Find("*", .Cells(Rows.Count, .Columns.Count), SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row
Set fRng = .Range("A2:A" & LR)
If Not .Aut**ilterMode Then
.Range("A3").Aut**ilter
End If
.Range("A3:A" & LR).Aut**ilter Field:=1, Criteria1:=Me.ComboBox2.Value
Me.tbResCol1.Value = .Aut**ilter.Range.**fset(1).SpecialCells(xlCellTypeVisible).Cells(0, 2).Value
Me.tbResCol2.Value = .Aut**ilter.Range.**fset(1).SpecialCells(xlCellTypeVisible).Cells(0, 3).Value
Me.tbResCol3.Value = .Aut**ilter.Range.**fset(1).SpecialCells(xlCellTypeVisible).Cells(0, 4).Value
Me.tbResCol4.Value = .Aut**ilter.Range.**fset(1).SpecialCells(xlCellTypeVisible).Cells(0, 5).Value
Me.tbResCol5.Value = .Aut**ilter.Range.**fset(1).SpecialCells(xlCellTypeVisible).Cells(0, 6).Value
.Aut**ilterMode = False
End With
Me.ComboBox1.Enabled = True
End Sub