Comparing Strings with VBA code

ThatGuyNamedDean

New Member
Joined
Apr 16, 2015
Messages
9
I have a large data set with multiple columns and a significant number of rows. Each column has a string with a number in the same place but the number is different for each column. Due to typo errors I want to compare each column to the first column, which I know is correct. Is there a way for me to compare a cell with the cell next to it but only using a certain part of the text within the cell? An example is posted below of what I'm looking at.

ColumnA - abcd$1$abcd.ABCD


ColumnB - abcd$5$abcd.ABCD


I would ultimately like to write a code to highlight a cell if the number is different from the cell above it or if any of the letters are different from the cell to the left of it.

I've compared two cells before but using the value in the entire cell.

Thank you in advance for your help!
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
If everything in row (2) should be the same as everything in row (1) and
If everything in row (3) should be the same as everything in row (2) and etc. etc.

And if:

If everything in column (2) should be the same as everything in column (1) and
If everything in column (3) should be the same as everything in column (2) etc. etc.

Sounds like to me everything in your entire sheet should be exactly the same
 
Upvote 0
Not quite...

Each number is the same in each column and all the letters are the same in each row.

Which means that numbers vary by column and letters vary by row and why I want to compare only the letters to the column next to it and the numbers to the row above it.
 
Upvote 0

Forum statistics

Threads
1,214,954
Messages
6,122,461
Members
449,085
Latest member
ExcelError

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top