thefirstvalue = thisworkbook.worksheets("sheet1").range("A1").value
thesecondvalue = thisworkbook.worksheets("sheet2").range("A1").value
if thefirstvalue = thesecondvalue then
'do something great here!!!
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!