A blank selection at the top of a User Form's drop down list.

USAMax

Well-known Member
Joined
May 31, 2006
Messages
843
Office Version
  1. 365
Platform
  1. Windows
I need users to be able to clear a field without having to select the text and hitting the back space or delete.

When they clear the field I will remove the selection from the sheet using the change event from the combo box but if someone puts their curer in the box and removes one letter that triggers the event. I need a blank field they can select.

How can I add a blank selection at the top of the drop down list in the User Form?
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
How is the list populated right now?
 
Upvote 0
Hi wigi,

I am using the UserForm1.AddItem to add the users but adding a space has not been adding it in the drop down.
 
Upvote 0
I need users to be able to clear a field without having to select the text and hitting the back space or delete.

How can I add a blank selection at the top of the drop down list in the User Form?

As an example, see if this does what you want:

Code:
With Me.ComboBox1
        .AddItem vbNullString
        For i = 1 To 10
            .AddItem i
        Next i
    End With

Dave
 
Upvote 0
As an example, see if this does what you want:
Code:
With Me.ComboBox1
        .AddItem vbNullString
        For i = 1 To 10
            .AddItem i
        Next i
    End With

Dave

Or:

Code:
ComboBox1.List = Split(" " & Join(Application.Transpose([row(1:10)])))

or:

Code:
ComboBox1.List = Split(" 1 2 3 4 5 6 7 8 9 10")
 
Upvote 0
That's fricken assume... I've seen somthing else done like that before but not in this context. Thanks Dave!
 
Upvote 0
Thank you Wigi, I have not had any luck using the split but I'll try it again.
 
Upvote 0
That's fricken assume... I've seen somthing else done like that before but not in this context. Thanks Dave!

Your welcome - As already shown, there are number of ways you can approach your requirment.

Thanks for feedback

Dave
 
Upvote 0

Forum statistics

Threads
1,215,360
Messages
6,124,489
Members
449,166
Latest member
hokjock

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