UsedRange & Formatting of Cells

  • Thread starter Thread starter JStone0218
  • Start date Start date
J

JStone0218

When I use the code below, the shading of the cells in column A impact the
UsedRange. Is this normal?

For Each cell In ActiveSheet.UsedRange.Columns(1).Rows
 
Accidentally hit Ctrl+Enter and sent my other response prematurely.

You can refine your code as follows:

For Each cell In
ActiveSheet.UsedRange.Columns(1).SpecialCells(xlCellTypeConstants).Rows.Addr
ess

This assumes that column 1 has constant and not formulas. If they contain
formulas, use xlCellTypeFormulas. If they contain both, you'll need to use a
range variable and define it for both using "Union".
 
Robert,

Thanks for the quick response. I followed your recomendation and it works
great!

James
 
Back
Top