View Single Post
 
Old 05-22-2021, 03:28 PM
Thorin23 Thorin23 is offline Windows 10 Office 2016
Novice
 
Join Date: Apr 2021
Posts: 4
Thorin23 is on a distinguished road
Default

Quote:
Originally Posted by Guessed View Post
In my opinion, the reference that LQuinn posted is interesting but not directly relevant to the question asked.

There is a lot of work to make this happen and to me the requested useability doesn't match the amount of effort to realise this workflow.

My questions are:
Is this a real task or a vba learning exercise?
Is there only ever 4 customers?
Is there only ever 3 replaceable items?
After an item has been replaced, will you want to find that same location again (linked to the same row) to do another pass?
First of all, thank you to both of you for your interest to my problem and sorry for the delay of my answer.

I recognise this problem requires a lot of work. That's why I manage the word document to another way. I previously said
Quote:
Some paragraphs of the Word document may be intended for different customers
I modified that in order to have one word document for each customer. So the problem is now completely different from the previous one. Indeed, the userform with the textbox and listbox isn't necessary because all could be replaced automatically. The first word of the Word document concerns the customer (Customer 1, Customer 2 etc...).

So , I think the macro could be (but I don't know how to translate in VBA):

-Open the Excel binder
- Look at the first column 'code' and "memorize" all the codes
- Go to the word document
- If the first word of the word document is 'Customer 1' , search all the codes memorized in the document and replace them (and all their occurrences) by the corresponding cells of the excel table (I mean here cells of the column customer 1).
- If the first word is 'Customer 2' , search all the codes memorized in the document and replace all the codes (and all their occurrences) by the corresponding cells of the excel table (I mean here cells of the column customer 2) etc ...

I attached the new Word Document.

I'm really sorry for this changement of problem but you made me realize that this poser requires a lot of work and isn't really pertinent for what I have to do here.

To answer your questions:
- Yes it's a real task I had to do here.
- There is several customers (approximately 10)
- So now, for one coded word, there will be just one possible word remplacement .
- After an item has been replaced, I don't want to do another pass.

Thank you again for your involvement and your help.
Attached Files
File Type: docm Example of text.docm (19.4 KB, 8 views)
File Type: xlsx references binder.xlsx (9.5 KB, 8 views)
Reply With Quote