Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using UsedRange as limits in a For Each loop but for cells on another sheet ? tur13o Excel Programming 2 October 23rd 03 01:18 PM
UsedRange on blank sheet? mike lee Excel Programming 3 October 16th 03 12:25 AM
finding last row number of UsedRange Jamie Martin[_2_] Excel Programming 4 September 26th 03 06:13 PM
UsedRange problem Andy Excel Programming 2 September 18th 03 05:17 PM
Usedrange Terry VanDuzee Excel Programming 6 August 10th 03 05:57 PM


All times are GMT +1. The time now is 08:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"