How to remove the first item in a combo box

Status
Not open for further replies.

Pookiemeister

Well-known Member
Joined
Jan 6, 2012
Messages
563
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
VBA Code:
Private Sub UserForm_Initialize()
    Me.Caption = "Maintenance Requster"
    'Me.cmbMaintPersonnel.List = Sheets("Maintenance Contact").Range("C2:C10001").Value
    
    Dim listLength As Integer
    Dim wks As Worksheet
    Dim cmbMaintList As Range
        
    Set wks = Worksheets("Maintenance Contact")
    listLength = Worksheets("Maintenance Contact").Cells(Rows.Count, "A").End(xlUp).Row '<==== finds the length of the list
    For x = 1 To listLength
        If wks.Cells(x, 1) <> "" Then '<=== ignores the blank spaces
            With cmbMaintPersonnel '<=== name of your comboBox
                .AddItem (wks.Cells(x, 3).Value) '<==== adds it to the list
            End With
        End If
    Next x
    
End Sub
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Duplicate to: How to remove the first item in a combo box

In future, please do not post the same question multiple times. Per Forum Rules (#12), posts of a duplicate nature will be locked or deleted.

In relation to your question here, I have closed this thread so please continue in the linked thread. If you do not receive a response, you can "bump" it by replying to it yourself, though we advise you to wait 24 hours before doing so, and not to bump a thread more than once a day.
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,213,560
Messages
6,114,306
Members
448,564
Latest member
ED38

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