excel - Compare two cells with the same word variant -
Can anyone help me with an Excel formula, whether a cell with a string of text same
P> cell A2: if I have thanks attached Place the module in a module and call it a worksheet as a function, such as code < / P> orange grapes apple
A1 is the same or not to
A2
= sCompare (A1, A2)
public function sCompare (S1 as string, S2 as string) Boolean dim vArr1, vArr2, lLoop long, in the form of lLoop2 long, bMatch boolean vArr1 = the form of split As in (trim (S1), "") vArr2 = split (trim (s2), "") if Ubound (vArr1) & lt; & Gt; For UBound (vArr2) lLoop again to exit function = 0 to UBound (vArr1) bMatch = false to lLoop2 = 0 to UBound (vArr2) then vArr1 (lLoop) = vArr2 (lLoop2) then bMatch = end Then the next lLoop2 then true exit for bMatch = false then exit the function next lLoop sCompare = True End Function
Comments
Post a Comment