Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-13-2013, 06:58 PM
leemoreau leemoreau is offline Help with a drop down in userform and variables Windows 8 Help with a drop down in userform and variables Office 2013
Novice
Help with a drop down in userform and variables
 
Join Date: Sep 2013
Posts: 8
leemoreau is on a distinguished road
Default Help with a drop down in userform and variables

Hi everyone,

New to VB not looking necessarily for someone to do this for me just if there's a term or something so that I can better search Google for how to do this.

Basically I have a standard Word file with a lot of docvariable fields, and then a userform where users enter text into the fields, and when hitting Ok it populates that into the Word document which is easy.



I'm trying to figure out how to do an if statement I think it is. So on the word document there's a heading "Sales rep" and it has 3 docvariables on 3 rows (I'd do it on 1 if it's possible to have a variable be formatted to be multiple lines). So basically the first line the variable name is "Full Name" second line and variable is "Phone Number" and 3rd line and variable is "Email address".

What I want is on the userform, a drop down that has a listing of 5 sales reps names. If the user clicks John Smith on the drop down and Saves the form, it then fills in John Smith, his number and his email. If they select a different user, it does the same with their info.

I'm sure this is pretty straight forward I just wanted to find out if this was called anything in particular so I know what to search for in learning how to do this? Thanks!!!
Reply With Quote
  #2  
Old 09-14-2013, 06:01 AM
gmaxey gmaxey is offline Help with a drop down in userform and variables Windows 7 32bit Help with a drop down in userform and variables Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,437
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Well if you are using Word 2013 and all of your users are using Word 2007 or higher then content controls (vice document variables) would, I think, be a better choice for data targets in the document.

What you need is a three column listbox contol. Put the sales rep name in column 1 (0 in control speak), the phone number in column 2 (1) and the email in column 2 (1). You can hide the contents of columns 2 and 3 (1 and 2) and only show the sales rep name in the listbox. When the user makes a selection and clicks ok then you populate the variables or content controls with the listbox column values.

Lots of methods and techniques here: http://gregmaxey.com/word_tip_pages/..._combobox.html
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help, auto select drop down by another drop down value? skrallemand Word VBA 3 09-11-2013 11:55 AM
Find and replace using variables jago25_98 Word 1 01-31-2012 04:30 AM
Help with a drop down in userform and variables Nesting Variables SET, LISTNUM, and REF Wyskers Word 1 11-13-2011 05:43 AM
changing variables in MS word - please help McGinzo Word 0 08-24-2011 06:25 AM
Envelopes with Document Variables mailtobln Word 0 02-11-2009 10:48 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:40 AM.


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