ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,832
- Office Version
- 2007
- Platform
- Windows
I am using this short code which will search from Bottom of sheet to the Top.
What change do i need to make to it so it searches from Top of the sheet & down the page.
Thanks
What change do i need to make to it so it searches from Top of the sheet & down the page.
Thanks
VBA Code:
Private Sub CommandButton2_Click()
Dim s$, r As Range, i&, ws As Worksheet
Me.ListBox1.Clear
s = Me.TextBox8
If s = "" Then Exit Sub
Set ws = Sheets("POSTAGE")
With Me.ListBox1
.ColumnCount = 4
.ColumnWidths = "220;130;160;10"
For i = ws.Range("B" & Rows.count).End(xlUp).Row To 7 Step -1
If InStr(1, ws.Cells(i, "B"), s, 1) Then
.AddItem ws.Cells(i, "B")
.List(.ListCount - 1, 1) = ws.Cells(i, "d") ' INFO
.List(.ListCount - 1, 2) = ws.Cells(i, "g").Text ' DATE DELIVERED
.List(.ListCount - 1, 3) = i
End If
Next
End With
End Sub