Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-12-2016, 03:25 AM
MiniMum97 MiniMum97 is offline Is there a way of having text automatically inserted based on the selection of other text? Windows 7 64bit Is there a way of having text automatically inserted based on the selection of other text? Office 2013
Novice
Is there a way of having text automatically inserted based on the selection of other text?
 
Join Date: Dec 2015
Posts: 2
MiniMum97 is on a distinguished road
Smile Is there a way of having text automatically inserted based on the selection of other text?

Hi

I would like to set up a Word document so that, based on the selection of the name of a GP surgery, the surgery's fax number will automatically appear in another part of the document.

There are about 30 different surgeries and at the moment we have separate documents for each of them, I would like to combine them into one document.

Is there a way of doing this?

Many thanks
Reply With Quote
  #2  
Old 04-12-2016, 03:48 AM
gmayor's Avatar
gmayor gmayor is offline Is there a way of having text automatically inserted based on the selection of other text? Windows 10 Is there a way of having text automatically inserted based on the selection of other text? Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,103
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

As with your other question, which presumably is related to this one, you are going to need macros to achieve this, so it would probably make sense to create a document template, with a userform containing a combobox to select the surgery and then write the surgery name and the associated fax number to the document.

I would use a multi-column combo box to hold the surgery details and I would maintain the surgery list in an Excel worksheet, which can be quickly read into the combo box. See http://www.gmayor.com/Userform_ComboBox.html for example code to read the data into the combobox For the basics, see Word MVP FAQ - Userforms http://word.mvps.org/FAQs/Userforms.htm for a more in depth explanation, see http://gregmaxey.com/Create_and_employ_a_UserForm.htm

When a new document is created the userform can be popped up and the surgery selected. The information relating to that selection is then written to the document as appropriate.
__________________
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 04-12-2016, 06:09 AM
macropod's Avatar
macropod macropod is offline Is there a way of having text automatically inserted based on the selection of other text? Windows 7 64bit Is there a way of having text automatically inserted based on the selection of other text? 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

For an alternative approach that is easily maintained and doesn't require a separate data file, see: https://www.msofficeforums.com/word-...html#post46903
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
text based on Combo box selection rosscortb Word VBA 3 03-16-2015 06:57 PM
Hide/Unhide Text Based on Drop Down Selection gw1500se Word 3 02-19-2015 12:17 PM
Is there a way of having text automatically inserted based on the selection of other text? Show/Hide Text based on Checkbox Selection tammytran105 Word VBA 7 10-02-2014 04:30 PM
Is there a way of having text automatically inserted based on the selection of other text? Hide/Unhide a Block of Text Based on Choice Selection inquirer Word VBA 7 09-22-2014 04:41 PM
Macro to populate a text form field based on dropdown selection koloa Word 0 10-20-2011 11:52 AM

Other Forums: Access Forums

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