Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-09-2018, 03:19 PM
jrooney7 jrooney7 is offline How to populate a userform combobox from an excel worksheet Windows 7 64bit How to populate a userform combobox from an excel worksheet Office 2013
Novice
How to populate a userform combobox from an excel worksheet
 
Join Date: Sep 2018
Posts: 23
jrooney7 is on a distinguished road
Default How to populate a userform combobox from an excel worksheet


Hello all,

I am been researching this topic, and being new to vba, I'm having trouble figuring out how to modify existing examples to my purposes. I have a document template containing a userform: "UserForm1". This userform has two comboboxes: "HowCleanedComboBox" and "CaliberComboBox". I would like to populate these comboboxes from an Excel worksheet "Dropdowns.xlsm" that contains the named ranges "HowCleaned" and "Caliber" at columns C and I, respectively.

I have inserted the following code, but I have a suspicion that I am barely scratching the surface of what I'll need to do :/

Code:
Private Sub UserForm_Initialize()

xlFillList ListOrComboBox:=Me.HowCleanedComboBox, _
iColumn:=3, _
strWorkbook:="C:\Users\Public\Documents\FA worksheet changes\Word Worksheets\Dropdowns.xlsm", _
strRange:="HowCleaned", _
RangeIsWorksheet:=True, _
RangeIncludesHeaderRow:=True

xlFillList ListOrComboBox:=Me.CaliberComboBox, _
iColumn:=9, _
strWorkbook:="C:\Users\Public\Documents\FA worksheet changes\Word Worksheets\Dropdowns.xlsm", _
strRange:="Caliber", _
RangeIsWorksheet:=True, _
RangeIncludesHeaderRow:=True

End Sub
When I try to run the userform, I get this error: "Compile error: Sub or function not defined." at the very beginning (the Private Sub line). Any help (in small words) would be greatly appreciated!!
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to populate a userform combobox from an excel worksheet Populate Combobox from Excel into a Word UserForm ferguson4848 Word VBA 3 10-28-2016 09:05 PM
Userform calls other userform, then populate worksheet Lehoi Excel Programming 0 02-03-2016 02:58 PM
How to populate a userform combobox from an excel worksheet Using combobox to pass data from an Excel spread sheet to text boxes on userform Stewie840 Word VBA 14 12-17-2015 10:13 PM
Trying to populate Word bookmarks with excel UserForm smd1112 Excel Programming 7 09-03-2014 09:42 PM
How to populate a userform combobox from an excel worksheet VB code: populate combobox from columns in Excel file billybeach Outlook 2 04-27-2013 04:38 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:28 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft