ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,832
- Office Version
- 2007
- Platform
- Windows
Here is the code for a Listbox.
I wish to be able to move the row number over so i can then see all the text to its left.
I have altered the row witdh 100 values but i see no movement in the columns for which i supply a screenshot.
Do you see an error which is not allowing me to do this ?
Thanks
I wish to be able to move the row number over so i can then see all the text to its left.
I have altered the row witdh 100 values but i see no movement in the columns for which i supply a screenshot.
Do you see an error which is not allowing me to do this ?
Thanks
VBA Code:
Private Sub FindInfo_Click()
Dim r As Range, f As Range, Cell As String, added As Boolean
Dim sh As Worksheet
Set sh = Sheets("POSTAGE")
sh.Select
With ListBoxFind
.Clear
.ColumnCount = 2
.ColumnWidths = "100;100" ' HERE
If TextBoxSearchColumnD.Value = "" Then Exit Sub
Set r = Range("D9", Range("D" & Rows.count).End(xlUp))
Set f = r.Find(TextBoxSearchColumnD.Value, LookIn:=xlValues, LookAt:=xlPart)
If Not f Is Nothing Then
Cell = f.Address
Do
added = False
For i = 0 To .ListCount - 1
Select Case StrComp(.List(i), f.Value, vbTextCompare)
Case 0, 1
.AddItem f.Value, i
.List(i, 1) = f.Row
added = True
Exit For
End Select
Next
If added = False Then
.AddItem f.Value
.List(.ListCount - 1, 1) = f.Row
End If
Set f = r.FindNext(f)
Loop While Not f Is Nothing And f.Address <> Cell
TextBoxSearchColumnD = UCase(TextBoxSearchColumnD)
.TopIndex = 0
Else
MsgBox "NO ITEM WAS FOUND USING THAT INFORMATION", vbCritical, "POSTAGE SHEET ITEM SEARCH"
TextBoxSearchColumnD.Value = ""
End If
End With
Me.ListBoxReplace.List = Me.ListBoxFind.List
End Sub