Drop Down box in Userform to autopopulate a list from sheet14

Patriot2879

Well-known Member
Joined
Feb 1, 2018
Messages
1,259
Office Version
  1. 2010
Platform
  1. Windows
HI Please can you help me i have a dropdown box in a userform and sheet14 i have a list of names, in the combobox named 'MTBox' i want this to autopopulate with the names in Sheet14, i have done the following code below that i found on the internet but this doesn't do anything, no errors or no list populated, please can yo uhelp me on this, i am pretty new to VBA coding, and your help is greatly appreciated.
Code:
[B]Private Sub MTBox_Change()

With Range("MTBox_Change").Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, _
Operator:=xlBetween, Formula1:="=Sheet14!A1:A60"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End Sub[/B]
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
That code does not do what you think it does.

This will populate the Combobox with the names from Sheet14 Column A. It does it when the userform is initialized.

Code:
Private Sub UserForm_Initialize()
    
    MTBox.RowSource = ""
    MTBox.List = Sheets("Sheet14").Range("A1", Sheets("Sheet14").Range("A" & Rows.Count).End(xlUp)).Value
    
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,159
Members
453,021
Latest member
Justyna P

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