Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default colouring the entire row to a color .


Based on conditions i would like to color the entire row permanently.
For eg:

If column C is of value "Y" then i need the entire row's fill color t
be changed to red.
The macro i wrote is not working .Pl ease help

--
roshinpp_7
-----------------------------------------------------------------------
roshinpp_77's Profile: http://www.excelforum.com/member.php...fo&userid=3492
View this thread: http://www.excelforum.com/showthread.php?threadid=55027

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default colouring the entire row to a color .

Hi Roshinpp,

Try something like:

'================
Public Sub Tester()
Dim rng As Range
Dim rcell As Range

Set rng = ActiveSheet.Range("C1:C100") '<<==== CHANGE
For Each rcell In rng.Cells
With rcell
If UCase(.Value) = "Y" Then
.EntireRow.Interior.ColorIndex = 3
End If
End With
Next rcell

End Sub
'<<================



---
Regards,
Norman



"roshinpp_77"
wrote in message
...

Based on conditions i would like to color the entire row permanently.
For eg:

If column C is of value "Y" then i need the entire row's fill color to
be changed to red.
The macro i wrote is not working .Pl ease help.


--
roshinpp_77
------------------------------------------------------------------------
roshinpp_77's Profile:
http://www.excelforum.com/member.php...o&userid=34924
View this thread: http://www.excelforum.com/showthread...hreadid=550276



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default colouring the entire row to a color .

perhaps if we could see the macro you wrote?

but something like

for each cell in range("C1:C100")
if cell.value="Y" then cell.EntireRow.Interior.ColorIndex = 3
next

would do it for you
roshinpp_77 wrote:
Based on conditions i would like to color the entire row permanently.
For eg:

If column C is of value "Y" then i need the entire row's fill color to
be changed to red.
The macro i wrote is not working .Pl ease help.


--
roshinpp_77
------------------------------------------------------------------------
roshinpp_77's Profile: http://www.excelforum.com/member.php...o&userid=34924
View this thread: http://www.excelforum.com/showthread...hreadid=550276


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default colouring the entire row to a color .


roshinpp_77 wrote:

Based on conditions i would like to color the entire row permanently.
For eg:

If column C is of value "Y" then i need the entire row's fill color to
be changed to red.
The macro i wrote is not working .Pl ease help.


--
roshinpp_77
------------------------------------------------------------------------
roshinpp_77's Profile: http://www.excelforum.com/member.php...o&userid=34924
View this thread: http://www.excelforum.com/showthread...hreadid=550276



Hi

This will do it automatically

Private Sub Worksheet_Change(ByVal Target As Range)
Dim cell
Set cell = Application.Intersect(Target, Range("C:C"))
If cell Is Nothing Then
Exit Sub
ElseIf cell = "Y" Then
Target.EntireRow.Interior.ColorIndex = 3
End If
End Sub


Cheers Christian



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default colouring the entire row to a color .


Hi Christian...thanks ...but its not working..i think something i
missed out..nothing is happening to the changes made..pls advice.


Regds,Roshin


ChristianH Wrote:
roshinpp_77 wrote:

Based on conditions i would like to color the entire ro

permanently.
For eg:

If column C is of value "Y" then i need the entire row's fill colo

to
be changed to red.
The macro i wrote is not working .Pl ease help.


--
roshinpp_77


------------------------------------------------------------------------
roshinpp_77's Profile

http://www.excelforum.com/member.php...o&userid=34924
View this thread

http://www.excelforum.com/showthread...hreadid=550276


Hi

This will do it automatically

Private Sub Worksheet_Change(ByVal Target As Range)
Dim cell
Set cell = Application.Intersect(Target, Range("C:C"))
If cell Is Nothing Then
Exit Sub
ElseIf cell = "Y" Then
Target.EntireRow.Interior.ColorIndex = 3
End If
End Sub


Cheers Christia


--
roshinpp_7
-----------------------------------------------------------------------
roshinpp_77's Profile: http://www.excelforum.com/member.php...fo&userid=3492
View this thread: http://www.excelforum.com/showthread.php?threadid=55027

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default colouring the entire row to a color .


roshinpp_77 wrote:

Hi Christian...thanks ...but its not working..i think something is
missed out..nothing is happening to the changes made..pls advice.


Regds,Roshin


ChristianH Wrote:
roshinpp_77 wrote:

Based on conditions i would like to color the entire row

permanently.
For eg:

If column C is of value "Y" then i need the entire row's fill color

to
be changed to red.
The macro i wrote is not working .Pl ease help.


--
roshinpp_77

------------------------------------------------------------------------
roshinpp_77's Profile:

http://www.excelforum.com/member.php...o&userid=34924
View this thread:

http://www.excelforum.com/showthread...hreadid=550276


Hi

This will do it automatically

Private Sub Worksheet_Change(ByVal Target As Range)
Dim cell
Set cell = Application.Intersect(Target, Range("C:C"))
If cell Is Nothing Then
Exit Sub
ElseIf cell = "Y" Then
Target.EntireRow.Interior.ColorIndex = 3
End If
End Sub


Cheers Christian



--
roshinpp_77
------------------------------------------------------------------------
roshinpp_77's Profile: http://www.excelforum.com/member.php...o&userid=34924
View this thread: http://www.excelforum.com/showthread...hreadid=550276



Hi

Just tried it and it is working for me

Put it in the worksheet code module and if any cell in column C is
(capital Y )
then the row will change to red.

Christian

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 903
Default colouring the entire row to a color .

If you really need permanent change, you would use a
change event macro
http://www.mvps.org/dmcritchie/excel/event.htm
and you would have a companion macro to set the colors
initially. Macros are case sensitive.

But what you describe sounds like you want Conditional Formatting,
except that if you remove the C.F. the changes are not permanent,
they all disappear. (worksheet formulas are not case sensitive)
http://www.mvps.org/dmcritchie/excel/condfmt.htm

Select cell C1 then use Ctrl+A to select all cells (Excel 2002 and prior versions)
so that all cells are selected and cell C1 is the active cell.
Format, Conditional Formatting
Condition 1: Formula is: =$C1="Y"

---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"roshinpp_77" wrote in message
...

Based on conditions i would like to color the entire row permanently.
For eg:

If column C is of value "Y" then i need the entire row's fill color to
be changed to red.
The macro i wrote is not working .Pl ease help.


--
roshinpp_77
------------------------------------------------------------------------
roshinpp_77's Profile: http://www.excelforum.com/member.php...o&userid=34924
View this thread: http://www.excelforum.com/showthread...hreadid=550276



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
Applying color to an entire row Dave Excel Discussion (Misc queries) 2 December 3rd 07 10:36 PM
color entire row by using conditional format capital letter Excel Worksheet Functions 1 November 10th 07 09:55 AM
color entire row by using conditional format capital letter Excel Worksheet Functions 1 November 10th 07 09:24 AM
Change font color across entire row Mac Excel Discussion (Misc queries) 4 November 17th 06 04:13 AM
Change entire row color mthomas[_3_] Excel Programming 2 July 28th 05 12:43 AM


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

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"