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

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -