Userform column widths issue

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,226
Office Version
  1. 2007
Platform
  1. Windows
This is the code in use.
I have also supplied a screenshot.

My issue is the bar at the bottom of the screen & it shouldnt be there.
As you can see there is plenty of space to the right of the customers name but column width is 80
Making it more than 80 makes the bar worse.
Making it small than 80 then the bar is gone.

I cant see why i am not able to have the 80 more like 150 without the bar being shown

Do you see something in the code that ived missed.


Rich (BB code):
Private Sub TextBoxChassisNumber_Change()
TextBoxChassisNumber = UCase(TextBoxChassisNumber)
  Dim R As Range, f As Range, cell As String, added As Boolean
  Dim sh As Worksheet
  
  Set sh = Sheets("DATABASE")
  sh.Select
  With ListBox1
    .Clear
    .ColumnCount = 8
    .ColumnWidths = "170;110;50;80"
   If TextBoxChassisNumber.Value = "" Then Exit Sub
    Set R = Range("L6", Range("L" & Rows.Count).End(xlUp))
    Set f = R.Find(TextBoxChassisNumber.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.Offset(, -10).Value
              .List(i, 2) = f.Row
              .List(i, 3) = f.Offset(, -11).Value
              added = True
              Exit For
          End Select
        Next
        If added = False Then
          .AddItem f.Value
          .List(.ListCount - 1, 1) = f.Offset(, -10).Value
          .List(.ListCount - 1, 2) = f.Row
          .List(.ListCount - 1, 3) = f.Offset(, -11).Value
         
        End If
        Set f = R.FindNext(f)
      Loop While Not f Is Nothing And f.Address <> cell
      TextBoxSearch = UCase(TextBoxSearch)
      .TopIndex = 0
    Else
      MsgBox "NO CUSTOMER WAS FOUND USING THAT INFORMATION", vbCritical, "POSTAGE SHEET CUSTOMER NAME SEARCH"
      TextBoxChassisNumber.Value = ""
      TextBoxChassisNumber.SetFocus
    End If
  End With
End Sub
 

Attachments

  • 3421.jpg
    3421.jpg
    54.6 KB · Views: 4

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
I started off with a value of 50 for the column width which after setting to my liking all was ok until the last one where i could only get it yto be 70 without the bar
It seems like theres another column out of view but doesnt the column widths advise you how many columns there are ?
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,605
Messages
6,120,473
Members
448,967
Latest member
visheshkotha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top