Drop Down box in Userform to autopopulate a list from sheet14

Patriot2879

Well-known Member
Joined
Feb 1, 2018
Messages
1,227
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

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
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
brilliant thank you that works great :) much appreciated :) thank you
 
Upvote 0

Forum statistics

Threads
1,214,520
Messages
6,120,013
Members
448,935
Latest member
ijat

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