Related:
- Compare data in two columns
- Compare two worksheets and paste differences to another sheet - excel vba free download ✓ - Excel Forum
- Transfer data from one excel worksheet to another automatically - Guide
- Digital data transmission - Guide
- Excel compare two columns for partial matches - Guide
- Display two columns in data validation list but return only one - Guide
1 reply
Very simply:
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:
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!
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!