Compare data in two columns

Jumangi - Feb 11, 2018 at 09:11 AM - Latest reply: ac3mark 9319 Posts Monday June 3, 2013Registration dateModeratorStatus May 22, 2018 Last seen
- Feb 12, 2018 at 05:04 PM
Hello,

Q 4 U - pls and thank you

CCC=characters/letters
NNN=numerics

Trying to compare these two columns and identify partial matches between Column A and B where Column B has a dash abc after the numeric

Column A cccnnnnn
Column B cccnnnnn-abc

See more 

Your reply

1 reply

ac3mark 9319 Posts Monday June 3, 2013Registration dateModeratorStatus May 22, 2018 Last seen - Updated by ac3mark on 12/02/18 at 05:09 PM
0
Helpful
Very simply:

dim thefirstvalue
dim thesecondvalue

thefirstvalue = thisworkbook.worksheets("sheet1").range("A1").value
thesecondvalue = thisworkbook.worksheets("sheet2").range("A1").value

if thefirstvalue = thesecondvalue then
'do something great here!!!
end if



Have FUN!

P.S-You have a multi-step answer here, because you are also wanting to PARSE the value. It is a SPLIT command. As in:

thevariable = "cccnnnnn-abc"
Splitvariable = Split(thevariable,"-")
'now you look at the delimited value in an array of splitvariable, as in
msgbox(Splitvariable(1)) ' returns abc


If the above is confusing, you need to read arrays! But simply, the command of SPLIT can check for delimitors, and parse them. In this case, we have told SPLIT to use the "-" as the delimiter (because your variable has it in the part number). You can omit the delimiter, in which case it will find SPACES!

Respond to ac3mark