LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Range of even/odd rows

Hi everyone,

I am using VBA to format a big range of data whose even and odd rows are
formatted differently. Currently I use this code:

(myRange has 3000 rows and 100 columns)
With myRange
.Interior.ColorIndex = 2
For i = 2 To .Rows.count Step 2
.Rows(i).Interior.ColorIndex = 3
Next i
End With

The For loop seems to slow down my code. Is there any way to create a
range of even/odd rows. I tried the following way but I didn't work.

worksheets(1).range("A2:CV2,A4:CV4,....
...,A3000:CV3000").Interior.ColorIndex = 3

Your help or suggestion is very appreciated.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
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
How can change range to select active rows instead of :=Range("S10 ldiaz Excel Discussion (Misc queries) 7 August 29th 08 03:52 PM
formula to sort a range so that it matches the exact rows of a column that is outside that range? steveo Excel Discussion (Misc queries) 1 June 18th 06 02:05 AM
Sorting By a range of rows JSolesky Excel Discussion (Misc queries) 1 December 6th 05 06:26 PM
Rows in a Range John Smith[_12_] Excel Programming 3 November 14th 04 01:56 PM
group rows in a range based on criteria from another range (vba) Andy Excel Programming 2 April 28th 04 03:26 AM


All times are GMT +1. The time now is 02:49 AM.

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

About Us

"It's about Microsoft Excel"