Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-27-2016, 07:33 AM
ferguson4848 ferguson4848 is offline Populate Combobox from Excel into a Word UserForm Windows 10 Populate Combobox from Excel into a Word UserForm Office 2013
Novice
Populate Combobox from Excel into a Word UserForm
 
Join Date: Oct 2016
Posts: 2
ferguson4848 is on a distinguished road
Default Populate Combobox from Excel into a Word UserForm

I would like to create a UserForm that includes a combobox populated from data in an excel spreadsheet. After that, I'd like to insert that data into a Word document. I think I know how to handle the second half, but I'm having a tough time figuring out how to populate the combobox with the excel data.

Any assistance would be greatly appreciated.
Reply With Quote
  #2  
Old 10-28-2016, 12:07 AM
gmayor's Avatar
gmayor gmayor is offline Populate Combobox from Excel into a Word UserForm Windows 10 Populate Combobox from Excel into a Word UserForm Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

See the example code at http://www.gmayor.com/Userform_ComboBox.html
For the writing of data to the document see the FillBM function which you can find on my web site also.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 10-28-2016, 06:48 AM
ferguson4848 ferguson4848 is offline Populate Combobox from Excel into a Word UserForm Windows 10 Populate Combobox from Excel into a Word UserForm Office 2013
Novice
Populate Combobox from Excel into a Word UserForm
 
Join Date: Oct 2016
Posts: 2
ferguson4848 is on a distinguished road
Default

Thank you so much for that link. Your code is great. I do have one question.

I'm trying to use this as a letterhead application. So, instead of the words being placed where the cursor is, they would be aligned by the page. I think I know how to accomplish that, but my question is, is there a way to basically select all the text you just added and replace it with other text. Right now, it seems the form only will pull the data once or at the least just add a subsequent choice to the document. But I'd like to replace the text instead of adding new text.

Is that possible?

Again, thank you so much.
Reply With Quote
  #4  
Old 10-28-2016, 09:05 PM
gmayor's Avatar
gmayor gmayor is offline Populate Combobox from Excel into a Word UserForm Windows 10 Populate Combobox from Excel into a Word UserForm Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

If you bookmark the area you want to replace, the FillBM function will replace that bookmarked text with whatever you instruct it to. Run the userform again and it will replace the text again.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
Reply

Tags
combobox, populate, vba



Similar Threads
Thread Thread Starter Forum Replies Last Post
Populate Combobox from Excel into a Word UserForm 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
Populate Combobox from Excel into a Word UserForm VB code: populate combobox from columns in Excel file billybeach Outlook 2 04-27-2013 04:38 AM
how to populate textbox based on combobox selection in word IvanGeorgiev Word 1 02-21-2013 07:32 PM
Populate Combobox from Excel into a Word UserForm how to populate textbox based on combobox selection in word IvanGeorgiev Word VBA 1 02-21-2013 07:28 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:46 PM.


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