excel vba - Highlight cell values starting with the same 'n' chars -
i need highlight(in column) cell values starting same 'n' chars. find 'highlight duplicates' code , inserted left function on activecell:
each cl in rng if worksheetfunction.countif(rng, left(cl.value, 4)) > 1 cl.interior.colorindex = 6 end if next cl
but doesn't work because incompatibility of left , countif. solution insert new column calculates first n chars, apply original loop on it.
wonder if exists more elegant idea :) thank you.
does want? * wild card.
if worksheetfunction.countif(rng, left(cl.value, 4) & "*") > 1
Comments
Post a Comment