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 -

Laravel mail error `Swift_TransportException in StreamBuffer.php line 269: Connection could not be established with host smtp.gmail.com [ #0]` -

c# SetCompatibleTextRenderingDefault must be called before the first -