Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-20-2014, 10:24 AM
opencollar opencollar is offline Multiple entries in dropdown lists Windows 7 64bit Multiple entries in dropdown lists Office 2010 64bit
Novice
 
Join Date: May 2014
Posts: 1
opencollar is on a distinguished road
Default Macros for drop down list

Thanks Marcopod for your zip attachment. I've been following this thread and being new to VBA, I'm trying to figure out where in the macro I type in what text to display.

E.g., what i need is for someone to be abe to see full words in a dropdown list, but then display a Code corresponding to each word. I could have the code included in the dropdown with the word, then possibly only set it to show the first x characters (to only display the code). Any way to just display the code, and not the full words would be helpful. The macro looks like its what I need, but I cant figure out what text goes where.



I will have 4 separate dropdown lists with each list repeating down four to five lines.

Thanks,
Reply With Quote
  #2  
Old 05-20-2014, 02:17 PM
macropod's Avatar
macropod macropod is offline Multiple entries in dropdown lists Windows 7 32bit Multiple entries in dropdown lists Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

The values to display have been input into the first content control. That content control has both a Display text and a Value. The conditional outputs are stored in the value field, with | delimiters for each output line.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 08-07-2014, 05:23 AM
vincente vincente is offline Multiple entries in dropdown lists Windows 7 32bit Multiple entries in dropdown lists Office 2010 32bit
Novice
 
Join Date: Aug 2014
Posts: 4
vincente is on a distinguished road
Default

this is exactly what i'm looking for... But i know nothing about vba/macro's... can anybody quickly explain to me how to link the drop-down list to the text box?
I've tried copy-pasteing macropod's example, but that doesn't seem to work...

cheers
Reply With Quote
  #4  
Old 08-07-2014, 03:10 PM
macropod's Avatar
macropod macropod is offline Multiple entries in dropdown lists Windows 7 32bit Multiple entries in dropdown lists Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

There is no textbox in the attachment demo, just two content controls and the macro that does the updating.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 08-08-2014, 02:16 AM
vincente vincente is offline Multiple entries in dropdown lists Windows 7 32bit Multiple entries in dropdown lists Office 2010 32bit
Novice
 
Join Date: Aug 2014
Posts: 4
vincente is on a distinguished road
Default

ok, but the problem is that this is all new to me and i don't have a clue how to make it myself.

could you help me with this?
Reply With Quote
  #6  
Old 08-08-2014, 04:26 AM
macropod's Avatar
macropod macropod is offline Multiple entries in dropdown lists Windows 7 32bit Multiple entries in dropdown lists Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Open the document and click on the ¶ symbol on the Ribbon's Home tab to display the document's formatting. You should now be able to see that there are two content controls, separated by a manual line break, with a paragraph break following the second one. Click on the Ribbon's Developer tab, then on 'Design Mode'. This should make the content controls even more apparent and will reveal their titles - Client and ClientDetails, respectively.

To use these controls as-is in your own document, simply copy both of them, plus the macro code to your document. To change the Client dropdown's contents, click on it, then on 'Properties' on the Developer tab. There you can add/delete/modify the entries. Pay particular attention to how the DisplayName and Value are input, especially the latter.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 08-11-2014, 11:39 PM
vincente vincente is offline Multiple entries in dropdown lists Windows 7 32bit Multiple entries in dropdown lists Office 2010 32bit
Novice
 
Join Date: Aug 2014
Posts: 4
vincente is on a distinguished road
Thumbs down

Thanks man, it works!

Now one more question: is it possible to link another content control to the drop-down list?

Thanks
Reply With Quote
  #8  
Old 07-03-2017, 12:34 PM
Whytewhysper Whytewhysper is offline Multiple entries in dropdown lists Windows 10 Multiple entries in dropdown lists Office 2016
Novice
 
Join Date: Jul 2017
Location: Aurora, CO
Posts: 2
Whytewhysper is on a distinguished road
Default

Paul,

I do not see any macro code to copy. Is there someplace special I should be looking for the code?

Tim M
Reply With Quote
  #9  
Old 05-22-2021, 11:46 AM
enci101 enci101 is offline Multiple entries in dropdown lists Windows 10 Multiple entries in dropdown lists Office 2019
Novice
 
Join Date: May 2021
Location: Frankfurt, Germany
Posts: 2
enci101 is on a distinguished road
Default Three dependent form fields

Hello,
I'm trying to create an invoice template. Is there a possibility to have 3 text fields filled out depending on whats chosen in a dropdown list? The problem is that the text for each field needs to be a different one. Everything is supposed to be in one line in a table that can be replicated using ContentControl.
E.g.:

Product Name (from dropdown list)
-> Product number
-> Additional info
-> Price

Thanks in advance

Enci
Reply With Quote
  #10  
Old 08-17-2017, 11:08 PM
crosling crosling is offline Multiple entries in dropdown lists Windows 10 Multiple entries in dropdown lists Office 2013
Novice
 
Join Date: Aug 2017
Posts: 2
crosling is on a distinguished road
Default Getting the macro to work

Hi Macropod

I am having difficulty to get your macro to work in my document. (I have never used macros before)

I have been creating a word template.
I copied across - Client and client details.
I dont know how to copy and paste the macro across so it will work in my template.

Also, does my template have to be saved as a word enabled template for it to work?

Thank you
Reply With Quote
  #11  
Old 10-25-2017, 05:40 AM
strodden strodden is offline Multiple entries in dropdown lists Windows 10 Multiple entries in dropdown lists Office 2010 32bit
Novice
 
Join Date: Aug 2017
Posts: 22
strodden is on a distinguished road
Default Ongoing work in same document

I'm attaching the same document that I successfully got working earlier in this thread. When I recently added three names to my dropdown, the macro that updates names and phone numbers stopped working for my coworkers, but not for me! Not sure what's different on my machine vs. theirs. Thoughts?



Seth
Attached Files
File Type: docm Proposal Sheet Test.docm (105.5 KB, 137 views)
Reply With Quote
  #12  
Old 03-29-2018, 04:41 PM
Cold in Skagway Cold in Skagway is offline Multiple entries in dropdown lists Windows 7 64bit Multiple entries in dropdown lists Office 2010 64bit
Novice
 
Join Date: Mar 2018
Posts: 3
Cold in Skagway is on a distinguished road
Default Moving Drop Down Menu selection values to text control area

Ok I admit it, I am no Word Wizard.
I have a word document with a drop down of three selections (so far) I want to move the value of each or even multiple selections down to a control text area in the document template below.

I know nothing about Macros, it's my first try at them. Driving me crazy. Two days. Sugar and caffeine high come and gone multiple time. Now at the "pulling out hair stage", don't want to progress to the "banging head on desk" stage.

And any VB experience I have is over 25 years old, and haven't used VB in over 15 years.

Someone said record what you want it to do, it is as simple as start recording the macro, clicking on the drop down selection and then clicking on the text control area and then clicking stop on the macro recorder?

Or am I missing a large part of all of this?
HELP!
Reply With Quote
  #13  
Old 05-19-2019, 06:47 AM
Jfisher88 Jfisher88 is offline Multiple entries in dropdown lists Mac OS X Multiple entries in dropdown lists Office 2019
Novice
 
Join Date: May 2019
Posts: 2
Jfisher88 is on a distinguished road
Default

Hi!

I downloaded your example and I have word opened. I can't modify or add different names the group though. I'm using version 15.4. If that helps. Also can you add this above a header? I've been trying to create a list of 5 different names and I can't seem to add a list above it.

Thanks,
Reply With Quote
  #14  
Old 11-12-2019, 10:11 AM
jmadsen jmadsen is offline Multiple entries in dropdown lists Windows 10 Multiple entries in dropdown lists Office 2016
Novice
 
Join Date: Nov 2019
Posts: 1
jmadsen is on a distinguished road
Default Does this work in the Header of Word?

Hello, I successful got this to work in my document. Thank you! However, I would like to have this work in the Header of Word. I keep getting an error message on this line of the VBA code. Is it possible?
ActiveDocument.ContentControls(2).Range.Text = StrDetails
Reply With Quote
  #15  
Old 08-12-2014, 12:32 AM
macropod's Avatar
macropod macropod is offline Multiple entries in dropdown lists Windows 7 32bit Multiple entries in dropdown lists Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

That's quite easy, but I can't give specific advice without knowing how much of the data are to be replicated.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple entries in dropdown lists Delete Multiple Entries dudeabides Office 1 07-04-2011 02:49 AM
Multiple task lists and multiple calendars kballing Outlook 0 01-18-2011 10:23 AM
Creating Multiple Contact Lists meltee78 Outlook 1 01-03-2011 09:45 PM
multiple calendar entries across a group halfhearted Outlook 0 10-11-2009 12:13 PM
Word Forms : Dropdown lists wferaera45 Word 0 04-06-2006 03:02 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:31 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