Hi all,
Another day, another VBA problem to solve Yaaay! Hope you can help me with this one...I'm just like
I have a range (C14 to C105 on tab 'Builder') that contains text in each cell. Each cell might contain one or multiple choice string(s) (see attached example - it won't let me post this as says it's HTML code?!)
On click of a button, I would like the script to
a) Check for any choice strings in each cell in the specified range (choice strings all start with {X, and end with })
Check a value in a specific cell on the 'Builder' tab for each choice string. E.g. If the choice string name is "choice1" it should check the value in cell E5 or if the choice string name is "choice2" it should check the value in cell E6 and so on
b) The script should then, based on the value it finds in E5 (or E6, depending on the choice string name), replace the full choice string with the relevant sub-string of that choice string...
c) ...and also replace the [X] in that sub-string with the value in E5 or E6.
Example:
1. Script finds choice string as part of text in a cell in range
2. Script checks for value in cell E5 (as choice1 would always lookup the value in E5) which is 5
3. Script finds relevant choice string bit (5 < first [X] coupons|) using the value (5) and deletes the rest of the choice string so only the following is left: first [X] coupons
4. Script replaces [X] in choice string with E5 value (5)
5. Final render should therefore be: first 5 coupons
I've attached an example file which might help. It's quite confusing, but would help me a lot with a massive translations project.
Any help appreciated...my brain is fried!
Bookmarks