Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
UsedRange & Formatting of Cells
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
UsedRange & Formatting of Cells
Yes, cell shading constitutes part of the UsedRange
-- _______________________ Robert Rosenberg R-COR Consulting Services Microsoft MVP - Excel "JStone0218" wrote in message ... 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
UsedRange & Formatting of Cells
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(xlCe llTypeConstants).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 Rosenberg R-COR Consulting Services Microsoft MVP - Excel "JStone0218" wrote in message ... 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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
UsedRange & Formatting of Cells
Robert,
Thanks for the quick response. I followed your recomendation and it works great! James You can refine your code as follows: For Each cell In ActiveSheet.UsedRange.Columns(1).SpecialCells(xlC ellTypeConstants).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 Rosenberg R-COR Consulting Services Microsoft MVP - Excel "JStone0218" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Using UsedRange as limits in a For Each loop but for cells on another sheet ? | Excel Programming | |||
UsedRange on blank sheet? | Excel Programming | |||
finding last row number of UsedRange | Excel Programming | |||
UsedRange problem | Excel Programming | |||
Usedrange | Excel Programming |