Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-19-2021, 02:08 PM
Thorin23 Thorin23 is offline Function search/replace multiple choice Windows 10 Function search/replace multiple choice Office 2016
Novice
Function search/replace multiple choice
 
Join Date: Apr 2021
Posts: 4
Thorin23 is on a distinguished road
Default Function search/replace multiple choice

Hello everyone,


I ask for your help with a problem that I can't solve despite my research.
May be this problem has already been solved but I cannot find the thread.


I want to make a macro that allows the user to search/replace several words in a Word document with a choice in a proposal list (from an Excel table).
The words that need to be replaced in the Word document are coded as following: ZZZ1, ZZZ2, ZZZ3.
Proposals to replace these codes are in an excel table (preview in attached document).

I created a Userform in my Word document (see capture). This one presents a TextBox1 that displays one by one the words to replace (ZZZ1,ZZZ2,ZZZ3) in the Word document.
For each of these codes, there are several alternative options that I would like to see in the ListBox1. All the possibilities associated with each code are listed in an Excel table whose you have the preview below.

The user can then choose which words he wants to replace for example ZZZ1, he selects the remplacement word in the ListBox 1 and then if he presses OK and next, all the occurrences of the word ZZZ1 are replaced by his choice. Then the TextBox 1 presents the following word (example: ZZZ2 if it appears in the Word document otherwise it switches to ZZZ3 etc...) and so forth.

If the user clicks on one of the option button about the customer, I would like the ListBox 1 to pre-select the corresponding replacement word in advance. In this way, the user could click 'Ok at all' to replace all coded words (ZZZ1,ZZZ2,ZZZ3 ....).

Some paragraphs of the Word document may be intended for different customers, hence the possibility for the user to choose the replacement word himself and therefore not to click the 'Ok at all' button but the 'Ok and Next' button. In some cases, there will be only one customer so using the 'Ok at all' button might be interesting...

Hope I managed to be understandable. If you need any further information, please let me know.

I thank in advance all people who can help me.

Many thanks to you and have a nice evening.
Attached Images
File Type: jpg Reference Table with duplicate .JPG (39.4 KB, 30 views)
File Type: png USERform Word.png (14.8 KB, 30 views)
Attached Files
File Type: xlsx references binder.xlsx (9.0 KB, 10 views)
File Type: docm Example of text.docm (22.0 KB, 11 views)
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a Survey with multiple Choice Philipp Lobo Word 1 04-27-2015 05:25 PM
Function search/replace multiple choice Multiple Choice Drop Down List teza2k06 Word 1 04-29-2014 04:54 PM
Function search/replace multiple choice multiple choice question ENEMALI Word VBA 1 09-29-2013 09:05 PM
Function search/replace multiple choice How to make a multiple-choice test? micahfaulkner75 Mail Merge 1 09-12-2012 06:08 PM
Function search/replace multiple choice Multiple choice option boxes burnsie Word 3 07-08-2011 05:10 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:39 AM.


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