PC Review


Reply
Thread Tools Rate Thread

Cell Color Change

 
 
daphoenix
Guest
Posts: n/a
 
      25th Jun 2008
how would I Remove the fill color of every fourth row starting after the 4th
row.

thanks
 
Reply With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      25th Jun 2008
Try this. If you want row 4 also just change 8 to 4
Sub removecolorfromcellsinrow()
mc = "m"
For i = 8 To Cells(Rows.Count, mc).End(xlUp).Row Step 4
'MsgBox i
Cells(i, mc).Interior.ColorIndex = 0
Next i
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"daphoenix" <(E-Mail Removed)> wrote in message
news:F2F338BD-6250-432D-8609-(E-Mail Removed)...
> how would I Remove the fill color of every fourth row starting after the
> 4th
> row.
>
> thanks


 
Reply With Quote
 
daphoenix
Guest
Posts: n/a
 
      26th Jun 2008
Thanks for the help again don,

the code that you gave me only changes the color in column M, how would I
apply this to the entire row.

"Don Guillett" wrote:

> Try this. If you want row 4 also just change 8 to 4
> Sub removecolorfromcellsinrow()
> mc = "m"
> For i = 8 To Cells(Rows.Count, mc).End(xlUp).Row Step 4
> 'MsgBox i
> Cells(i, mc).Interior.ColorIndex = 0
> Next i
> End Sub
>
>
> --
> Don Guillett
> Microsoft MVP Excel
> SalesAid Software
> (E-Mail Removed)
> "daphoenix" <(E-Mail Removed)> wrote in message
> news:F2F338BD-6250-432D-8609-(E-Mail Removed)...
> > how would I Remove the fill color of every fourth row starting after the
> > 4th
> > row.
> >
> > thanks

>
>

 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      26th Jun 2008
>>Cells(i, mc).Interior.ColorIndex = 0
to
Cells(i, mc).ENTIREROW.Interior.ColorIndex = 0


--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"daphoenix" <(E-Mail Removed)> wrote in message
news:A22CD962-4FEA-4CB4-B41C-(E-Mail Removed)...
> Thanks for the help again don,
>
> the code that you gave me only changes the color in column M, how would I
> apply this to the entire row.
>
> "Don Guillett" wrote:
>
>> Try this. If you want row 4 also just change 8 to 4
>> Sub removecolorfromcellsinrow()
>> mc = "m"
>> For i = 8 To Cells(Rows.Count, mc).End(xlUp).Row Step 4
>> 'MsgBox i
>> Cells(i, mc).Interior.ColorIndex = 0
>> Next i
>> End Sub
>>
>>
>> --
>> Don Guillett
>> Microsoft MVP Excel
>> SalesAid Software
>> (E-Mail Removed)
>> "daphoenix" <(E-Mail Removed)> wrote in message
>> news:F2F338BD-6250-432D-8609-(E-Mail Removed)...
>> > how would I Remove the fill color of every fourth row starting after
>> > the
>> > 4th
>> > row.
>> >
>> > thanks

>>
>>


 
Reply With Quote
 
daphoenix
Guest
Posts: n/a
 
      26th Jun 2008
it works great thanks...but when running this the last row of the workbook is
still left filled in, is there a way to change this?

"Don Guillett" wrote:

> >>Cells(i, mc).Interior.ColorIndex = 0

> to
> Cells(i, mc).ENTIREROW.Interior.ColorIndex = 0
>
>
> --
> Don Guillett
> Microsoft MVP Excel
> SalesAid Software
> (E-Mail Removed)
> "daphoenix" <(E-Mail Removed)> wrote in message
> news:A22CD962-4FEA-4CB4-B41C-(E-Mail Removed)...
> > Thanks for the help again don,
> >
> > the code that you gave me only changes the color in column M, how would I
> > apply this to the entire row.
> >
> > "Don Guillett" wrote:
> >
> >> Try this. If you want row 4 also just change 8 to 4
> >> Sub removecolorfromcellsinrow()
> >> mc = "m"
> >> For i = 8 To Cells(Rows.Count, mc).End(xlUp).Row Step 4
> >> 'MsgBox i
> >> Cells(i, mc).Interior.ColorIndex = 0
> >> Next i
> >> End Sub
> >>
> >>
> >> --
> >> Don Guillett
> >> Microsoft MVP Excel
> >> SalesAid Software
> >> (E-Mail Removed)
> >> "daphoenix" <(E-Mail Removed)> wrote in message
> >> news:F2F338BD-6250-432D-8609-(E-Mail Removed)...
> >> > how would I Remove the fill color of every fourth row starting after
> >> > the
> >> > 4th
> >> > row.
> >> >
> >> > thanks
> >>
> >>

>
>

 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      26th Jun 2008

Must not be a multiple of 4.
you could add the line just before end sub
rows(Cells(Rows.Count, mc).End(xlUp).Row ).Interior.ColorIndex = 0

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"daphoenix" <(E-Mail Removed)> wrote in message
news:C59DDC95-BD4B-4931-8743-(E-Mail Removed)...
> it works great thanks...but when running this the last row of the workbook
> is
> still left filled in, is there a way to change this?
>
> "Don Guillett" wrote:
>
>> >>Cells(i, mc).Interior.ColorIndex = 0

>> to
>> Cells(i, mc).ENTIREROW.Interior.ColorIndex = 0
>>
>>
>> --
>> Don Guillett
>> Microsoft MVP Excel
>> SalesAid Software
>> (E-Mail Removed)
>> "daphoenix" <(E-Mail Removed)> wrote in message
>> news:A22CD962-4FEA-4CB4-B41C-(E-Mail Removed)...
>> > Thanks for the help again don,
>> >
>> > the code that you gave me only changes the color in column M, how would
>> > I
>> > apply this to the entire row.
>> >
>> > "Don Guillett" wrote:
>> >
>> >> Try this. If you want row 4 also just change 8 to 4
>> >> Sub removecolorfromcellsinrow()
>> >> mc = "m"
>> >> For i = 8 To Cells(Rows.Count, mc).End(xlUp).Row Step 4
>> >> 'MsgBox i
>> >> Cells(i, mc).Interior.ColorIndex = 0
>> >> Next i
>> >> End Sub
>> >>
>> >>
>> >> --
>> >> Don Guillett
>> >> Microsoft MVP Excel
>> >> SalesAid Software
>> >> (E-Mail Removed)
>> >> "daphoenix" <(E-Mail Removed)> wrote in message
>> >> news:F2F338BD-6250-432D-8609-(E-Mail Removed)...
>> >> > how would I Remove the fill color of every fourth row starting after
>> >> > the
>> >> > 4th
>> >> > row.
>> >> >
>> >> > thanks
>> >>
>> >>

>>
>>


 
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
Need Help, DataGrid, Cell color change on cell data change =?Utf-8?B?QnJpYW5ESA==?= Microsoft C# .NET 0 13th Jun 2007 03:45 PM
change fill color of a range of cells based on color of a cell? =?Utf-8?B?RGFyTWVsTmVs?= Microsoft Excel Programming 0 2nd Mar 2006 06:35 PM
How to change the default Border, Font Color, and Cell Color Elijah Microsoft Excel Misc 3 2nd Nov 2005 11:52 PM
Browse Forms Controls and change TextBox color based on cell color =?Utf-8?B?U3RlZmFuVw==?= Microsoft Excel Programming 0 21st Nov 2004 04:28 AM
Cell color change with the input of color coded text =?Utf-8?B?bmV3YnkgYmx1ZXM=?= Microsoft Excel Misc 1 19th Nov 2004 02:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:06 PM.