Forum Discussion

sanjex's avatar
sanjex
Copper Contributor
Apr 13, 2024

Automating editing between 2 cells

Hello!

I have been working on a project where given 2 columns in excel (A and B) where A is the original text and B was some text returned from else where, I have to manually go in and format B with the mistakes. This takes alot of time and I was wondering if there is a way to automate this.

 

So say for example the column in A is given as below:
Hello, my name is John Smith. It is very nice to meet you!


And the column in B is given below:

hello, my name John Smith? It is very nice to meet you.

 

I have to go in and edit it to show something like:
hello, my name (missing) John Smith(?)(full stop) It is very nice to meet you there(.)(exclamation mark)

 

Below are the formatting rules I have to currently follow

If the word in B is a different spelling to that in A, change the text colour to red and make it bold

If the word in B is a missing to that in A, write "(missing)"in red and make it bold

If the word in B is otherwise not in in A, change the text colour to green and make it bold

If there is a punctuation in B that is not in A, put the punctuation in brackets and change the colour to blue and make it bold

If there is a punctuation in A that is not in B, write the punctuation in bold and in brackets. 

 

 

 

  • NikolinoDE's avatar
    NikolinoDE
    Gold Contributor

    sanjex 

    To automate the editing process between columns A and B in Excel based on the formatting rules you provided, you can use a VBA macro. You will find the Macro in the attached file.

     

    My answers are voluntary and without guarantee!

     

    Hope this will help you.

     

    Was the answer useful? Mark as best response and like it!

    This will help all forum participants.

Resources