excel - Select all colored cells from conditional formatting -


i have range of cells (k6:m200) in sheet "summary" need use macro select cells colored based off conditional formatting. there following conditions:

  1. colored cells continuous k6 until whatever row not meet condition.
  2. not cells same color.

i'm new vba , macros i'm hoping can me figure out how this. i've tried few formulas , has not worked.

i'd suggest this:

sub selectcfcolours()     dim cell range     dim selrange range      each cell in range("k6:m200")         if cell.displayformat.interior.color <> cell.interior.color             if selrange nothing                 set selrange = cell             else                 set selrange = union(selrange, cell)             end if         end if     next      if not selrange nothing selrange.select end sub 

Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -