My sheet already has data. Unfortunately, later I realized that all the values in column E should be validated and changed as necessary by calling my own user-defined function and passing the values as the function parameter. For example, say I have the following data in column E:
E1: "This is a text in (E1)"
E2: "This is a text in (E2)"
...
E7000: "This is a text in (E7000)"
Now, I want every value in column E to be changed by a formula like this:
E1: = RemoveBrackets("This is a text in (E1)")
E2: = RemoveBrackets("This is a text in (E2)")
...
E7000: = RemoveBrackets("This is a text in (E7000)")
Supposing Excel supports Regex, my problem can be solved easily. but unfortunately Excel doesn’t. Could someone propose possible solutions to my problem?
Thanks in advance
1) Insert a new column “F”
2) Copy column E into F
3) Write in E1
4) Drag the E1 value through E7000
5) Hide column F.
Edit 1
You can do it with several passes of the Find/Replace feature:
Select the Column E before each PASS.
PASS 1
PASS 2
PASS 3
Edit 2
VB Regex substitute string function can be used from Excel.
You may dowload a toolpack such as Morefunc which supports a REGEX.SUBSTITUTE udf, or you could do your own udf using THIS as guideline.
I am posting here the code from the second reference, just for link independence:
Please read the full article, as you should turn on the Microsoft VBScript Regular Expressions 5.5 option in Excel first.
HTH