PC Review


Reply
Thread Tools Rate Thread

How can I color every other row

 
 
MrsMrfy
Guest
Posts: n/a
 
      13th Feb 2008
Help please.

I want to make it easier to use a large spreadsheet where two rows are
used for each record. Filling in the background color of every second
row prevents mistakes when entering data. I want to color only the
used range, not the entire row.

I recorded a macro and got the following:
TheRange.Activate
With Selection.Interior
.ColorIndex = 36
.Pattern = xlSolid
End With

I really appreciate the help.
 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      13th Feb 2008
On way:


Dim iCtr As Long
With ActiveSheet.UsedRange
For iCtr = .Row To .Rows(.Rows.Count).Row Step 2
With .Rows(iCtr).Interior
.ColorIndex = 36
.Pattern = xlSolid
End With
Next iCtr
End With

You may want to look at conditional formatting, too:
http://www.cpearson.com/excel/banding.htm

Or even Format|Autoformat (in xl2003 menus)

MrsMrfy wrote:
>
> Help please.
>
> I want to make it easier to use a large spreadsheet where two rows are
> used for each record. Filling in the background color of every second
> row prevents mistakes when entering data. I want to color only the
> used range, not the entire row.
>
> I recorded a macro and got the following:
> TheRange.Activate
> With Selection.Interior
> .ColorIndex = 36
> .Pattern = xlSolid
> End With
>
> I really appreciate the help.


--

Dave Peterson
 
Reply With Quote
 
Herbert Seidenberg
Guest
Posts: n/a
 
      13th Feb 2008
Select your range.
Format > AutoFormat > List1
Options > Formats to apply >
Uncheck all except Pattern
 
Reply With Quote
 
Bernard Liengme
Guest
Posts: n/a
 
      13th Feb 2008
Or use Format Conditional formatting:
Formula IS; =MOD(ROW(),2)=0 ; set colour
Formula IS: =MOD(ROW(),2)=1; set another colour
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"MrsMrfy" <(E-Mail Removed)> wrote in message
news:25f380df-2104-45d5-b346-(E-Mail Removed)...
> Help please.
>
> I want to make it easier to use a large spreadsheet where two rows are
> used for each record. Filling in the background color of every second
> row prevents mistakes when entering data. I want to color only the
> used range, not the entire row.
>
> I recorded a macro and got the following:
> TheRange.Activate
> With Selection.Interior
> .ColorIndex = 36
> .Pattern = xlSolid
> End With
>
> I really appreciate the help.



 
Reply With Quote
 
Lolly
Guest
Posts: n/a
 
      13th Feb 2008
On Feb 13, 10:16*am, Dave Peterson <peter...@verizonXSPAM.net> wrote:
> On way:
>
> * * Dim iCtr As Long * *
> * * With ActiveSheet.UsedRange
> * * * * For iCtr = .Row To .Rows(.Rows.Count).Row Step 2
> * * * * * * With .Rows(iCtr).Interior
> * * * * * * * * .ColorIndex = 36
> * * * * * * * * .Pattern = xlSolid
> * * * * * * End With
> * * * * Next iCtr
> * * End With
>
> You may want to look at conditional formatting, too:http://www.cpearson.com/excel/banding.htm
>
> Or even Format|Autoformat (in xl2003 menus)
>
>
>
>
>
> MrsMrfy wrote:
>
> > Help please.

>
> > I want to make it easier to use a large spreadsheet where two rows are
> > used for each record. *Filling in the background color of every second
> > row prevents mistakes when entering data. I want to color only the
> > used range, not the entire row.

>
> > I recorded a macro and got the following:
> > * * * * * *TheRange.Activate
> > * * * * * * *With Selection.Interior
> > * * * * * * * * *.ColorIndex = 36
> > * * * * * * * * *.Pattern = xlSolid
> > * * * * * * *End With

>
> > I really appreciate the help.

>
> --
>
> Dave Peterson- Hide quoted text -
>
> - Show quoted text -


Dave you are wonderful. I tried your code and it worked perfectly and
was exactly what I wanted. Thanks a million.
 
Reply With Quote
 
Lolly
Guest
Posts: n/a
 
      13th Feb 2008
On Feb 13, 11:36*am, "Bernard Liengme" <blien...@stfx.TRUENORTH.ca>
wrote:
> Or use Format Conditional formatting:
> Formula IS; =MOD(ROW(),2)=0 ; set colour
> Formula IS: =MOD(ROW(),2)=1; set another colour
> best wishes
> --
> Bernard V Liengme
> Microsoft Excel MVPhttp://people.stfx.ca/bliengme
> remove caps from email
>
> "MrsMrfy" <MrsM...@gmail.com> wrote in message
>
> news:25f380df-2104-45d5-b346-(E-Mail Removed)...
>
>
>
> > Help please.

>
> > I want to make it easier to use a large spreadsheet where two rows are
> > used for each record. *Filling in the background color of every second
> > row prevents mistakes when entering data. I want to color only the
> > used range, not the entire row.

>
> > I recorded a macro and got the following:
> > * * * * * TheRange.Activate
> > * * * * * * With Selection.Interior
> > * * * * * * * * .ColorIndex = 36
> > * * * * * * * * .Pattern = xlSolid
> > * * * * * * End With

>
> > I really appreciate the help.- Hide quoted text -

>
> - Show quoted text -


I used Dave's code because it seemed to fit my needs exactly but I
appreciate the solutions offered by others. I will keep your
suggestions as well. They may serve better at another time. Thanks.
 
Reply With Quote
 
Tyro
Guest
Posts: n/a
 
      14th Feb 2008
You don't state what version of Excel you're using; in Excel 2007, you can
make a table of your data and have Excel band every other row.

Tyro

"MrsMrfy" <(E-Mail Removed)> wrote in message
news:25f380df-2104-45d5-b346-(E-Mail Removed)...
> Help please.
>
> I want to make it easier to use a large spreadsheet where two rows are
> used for each record. Filling in the background color of every second
> row prevents mistakes when entering data. I want to color only the
> used range, not the entire row.
>
> I recorded a macro and got the following:
> TheRange.Activate
> With Selection.Interior
> .ColorIndex = 36
> .Pattern = xlSolid
> End With
>
> I really appreciate the help.



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
custom color for font color and or background shading color Ben Microsoft Excel Programming 2 5th May 2010 02:32 PM
RE: Color Codes: Different color with same color Index Ryan H Microsoft Excel Programming 0 5th Feb 2010 04:46 PM
color transition (color changes from dark color to light color) color transition Microsoft Powerpoint 2 21st Nov 2009 12:21 PM
AIO color & BW print, color & BW copy, pcfax, color scan A. L. Shaw, MD Printers 2 14th Jan 2006 04:44 AM
Fill Color/ Background Color/Tab Color M.Cave Microsoft Excel Misc 2 11th Oct 2004 02:10 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:23 PM.