Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
pol pol is offline
external usenet poster
 
Posts: 129
Default To give back ground colour for entire row on certain condition

Please let me help to give a colour for the entire row by certain condition
as follows

I have an excel sheet with the following column

A B
Code Qty

001 20
002 30
003 10
004 20
005 15
006 05

if in any of the cell in B is less than that of 10 , the back ground colour
of the entrire row of that cell having that condition = true should be in Red.

Please let me know

With thanks and Regards

Pol



  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 222
Default To give back ground colour for entire row on certain condition

That's conditional formatting, and I suggest you NOT apply conditional
formatting to ENTIRE rows or the entire workbook. Just apply this answer far
enough out to the right to be practical...as far as your data goes and
perhaps a column or two further.

Anyway, highlight all the cells from A2 to whatever your last cell choice,
them click on FORMAT CONDITIONAL FORMATTING. Use this formula:

Condition1: Formula Is:
=AND(ISNUMBER($B2),$B2<10)
Format...Pattern...select a red color

Now any rows with a value in column B less than 10 will light up.
--
"Actually, I *am* a rocket scientist." -- JB

Your feedback is appreciated, click YES if this post helped you.


"pol" wrote:

Please let me help to give a colour for the entire row by certain condition
as follows

I have an excel sheet with the following column

A B
Code Qty

001 20
002 30
003 10
004 20
005 15
006 05

if in any of the cell in B is less than that of 10 , the back ground colour
of the entrire row of that cell having that condition = true should be in Red.

Please let me know

With thanks and Regards

Pol



  #3   Report Post  
Posted to microsoft.public.excel.misc
pol pol is offline
external usenet poster
 
Posts: 129
Default To give back ground colour for entire row on certain conditio

Please let me know anybody , how I can write a macro for the mentioned
purpose. I need a sample macros.

Please with thanks

Pol

"JBeaucaire" wrote:

That's conditional formatting, and I suggest you NOT apply conditional
formatting to ENTIRE rows or the entire workbook. Just apply this answer far
enough out to the right to be practical...as far as your data goes and
perhaps a column or two further.

Anyway, highlight all the cells from A2 to whatever your last cell choice,
them click on FORMAT CONDITIONAL FORMATTING. Use this formula:

Condition1: Formula Is:
=AND(ISNUMBER($B2),$B2<10)
Format...Pattern...select a red color

Now any rows with a value in column B less than 10 will light up.
--
"Actually, I *am* a rocket scientist." -- JB

Your feedback is appreciated, click YES if this post helped you.


"pol" wrote:

Please let me help to give a colour for the entire row by certain condition
as follows

I have an excel sheet with the following column

A B
Code Qty

001 20
002 30
003 10
004 20
005 15
006 05

if in any of the cell in B is less than that of 10 , the back ground colour
of the entrire row of that cell having that condition = true should be in Red.

Please let me know

With thanks and Regards

Pol



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default To give back ground colour for entire row on certain conditio

If you are really looking for a macro.... try below. Set the Security level
to low/medium in (Tools|Macro|Security). From workbook launch VBE using
short-key Alt+F11. From menu 'Insert' a module and paste the below code.
Save. Get back to Workbook. Run macro from Tools|Macro|Run <selected macro()

Sub Macro()
Dim lngRow As Long
Dim lngLastRow As Long
lngLastRow = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row
For lngRow = 2 To lngLastRow
If IsNumeric(Range("B" & lngRow)) Then
'If greater than 0 and less than 10
'If Range("B" & lngRow) < 10 Then
If Range("B" & lngRow) 0 And Range("B" & lngRow) < 10 Then
Rows(lngRow).Interior.ColorIndex = 3
End If
End If
Next
End Sub

--
If this post helps click Yes
---------------
Jacob Skaria


"pol" wrote:

Please let me know anybody , how I can write a macro for the mentioned
purpose. I need a sample macros.

Please with thanks

Pol

"JBeaucaire" wrote:

That's conditional formatting, and I suggest you NOT apply conditional
formatting to ENTIRE rows or the entire workbook. Just apply this answer far
enough out to the right to be practical...as far as your data goes and
perhaps a column or two further.

Anyway, highlight all the cells from A2 to whatever your last cell choice,
them click on FORMAT CONDITIONAL FORMATTING. Use this formula:

Condition1: Formula Is:
=AND(ISNUMBER($B2),$B2<10)
Format...Pattern...select a red color

Now any rows with a value in column B less than 10 will light up.
--
"Actually, I *am* a rocket scientist." -- JB

Your feedback is appreciated, click YES if this post helped you.


"pol" wrote:

Please let me help to give a colour for the entire row by certain condition
as follows

I have an excel sheet with the following column

A B
Code Qty

001 20
002 30
003 10
004 20
005 15
006 05

if in any of the cell in B is less than that of 10 , the back ground colour
of the entrire row of that cell having that condition = true should be in Red.

Please let me know

With thanks and Regards

Pol



  #5   Report Post  
Posted to microsoft.public.excel.misc
pol pol is offline
external usenet poster
 
Posts: 129
Default To give back ground colour for entire row on certain conditio

This macro will work but the problem is it will take long time to work this
macros for large number of rows. Is it possible to give the rule of
conditional formating in a macros instead of using the loop.

Please let me know


"Jacob Skaria" wrote:

If you are really looking for a macro.... try below. Set the Security level
to low/medium in (Tools|Macro|Security). From workbook launch VBE using
short-key Alt+F11. From menu 'Insert' a module and paste the below code.
Save. Get back to Workbook. Run macro from Tools|Macro|Run <selected macro()

Sub Macro()
Dim lngRow As Long
Dim lngLastRow As Long
lngLastRow = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row
For lngRow = 2 To lngLastRow
If IsNumeric(Range("B" & lngRow)) Then
'If greater than 0 and less than 10
'If Range("B" & lngRow) < 10 Then
If Range("B" & lngRow) 0 And Range("B" & lngRow) < 10 Then
Rows(lngRow).Interior.ColorIndex = 3
End If
End If
Next
End Sub

--
If this post helps click Yes
---------------
Jacob Skaria


"pol" wrote:

Please let me know anybody , how I can write a macro for the mentioned
purpose. I need a sample macros.

Please with thanks

Pol

"JBeaucaire" wrote:

That's conditional formatting, and I suggest you NOT apply conditional
formatting to ENTIRE rows or the entire workbook. Just apply this answer far
enough out to the right to be practical...as far as your data goes and
perhaps a column or two further.

Anyway, highlight all the cells from A2 to whatever your last cell choice,
them click on FORMAT CONDITIONAL FORMATTING. Use this formula:

Condition1: Formula Is:
=AND(ISNUMBER($B2),$B2<10)
Format...Pattern...select a red color

Now any rows with a value in column B less than 10 will light up.
--
"Actually, I *am* a rocket scientist." -- JB

Your feedback is appreciated, click YES if this post helped you.


"pol" wrote:

Please let me help to give a colour for the entire row by certain condition
as follows

I have an excel sheet with the following column

A B
Code Qty

001 20
002 30
003 10
004 20
005 15
006 05

if in any of the cell in B is less than that of 10 , the back ground colour
of the entrire row of that cell having that condition = true should be in Red.

Please let me know

With thanks and Regards

Pol





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default To give back ground colour for entire row on certain conditio

Sub Macro()
Dim lngLastRow As Long
Application.ScreenUpdating = False
lngLastRow = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row
Rows("2:" & lngLastRow).Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=AND(ISNUMBER($B2),$B2<10)"
Selection.FormatConditions(1).Interior.ColorIndex = 3
Application.ScreenUpdating = True
End Sub
--
If this post helps click Yes
---------------
Jacob Skaria


"pol" wrote:

This macro will work but the problem is it will take long time to work this
macros for large number of rows. Is it possible to give the rule of
conditional formating in a macros instead of using the loop.

Please let me know


"Jacob Skaria" wrote:

If you are really looking for a macro.... try below. Set the Security level
to low/medium in (Tools|Macro|Security). From workbook launch VBE using
short-key Alt+F11. From menu 'Insert' a module and paste the below code.
Save. Get back to Workbook. Run macro from Tools|Macro|Run <selected macro()

Sub Macro()
Dim lngRow As Long
Dim lngLastRow As Long
lngLastRow = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row
For lngRow = 2 To lngLastRow
If IsNumeric(Range("B" & lngRow)) Then
'If greater than 0 and less than 10
'If Range("B" & lngRow) < 10 Then
If Range("B" & lngRow) 0 And Range("B" & lngRow) < 10 Then
Rows(lngRow).Interior.ColorIndex = 3
End If
End If
Next
End Sub

--
If this post helps click Yes
---------------
Jacob Skaria


"pol" wrote:

Please let me know anybody , how I can write a macro for the mentioned
purpose. I need a sample macros.

Please with thanks

Pol

"JBeaucaire" wrote:

That's conditional formatting, and I suggest you NOT apply conditional
formatting to ENTIRE rows or the entire workbook. Just apply this answer far
enough out to the right to be practical...as far as your data goes and
perhaps a column or two further.

Anyway, highlight all the cells from A2 to whatever your last cell choice,
them click on FORMAT CONDITIONAL FORMATTING. Use this formula:

Condition1: Formula Is:
=AND(ISNUMBER($B2),$B2<10)
Format...Pattern...select a red color

Now any rows with a value in column B less than 10 will light up.
--
"Actually, I *am* a rocket scientist." -- JB

Your feedback is appreciated, click YES if this post helped you.


"pol" wrote:

Please let me help to give a colour for the entire row by certain condition
as follows

I have an excel sheet with the following column

A B
Code Qty

001 20
002 30
003 10
004 20
005 15
006 05

if in any of the cell in B is less than that of 10 , the back ground colour
of the entrire row of that cell having that condition = true should be in Red.

Please let me know

With thanks and Regards

Pol



  #7   Report Post  
Posted to microsoft.public.excel.misc
pol pol is offline
external usenet poster
 
Posts: 129
Default To give back ground colour for entire row on certain conditio

Thanks a lot . It is working fine

"Jacob Skaria" wrote:

Sub Macro()
Dim lngLastRow As Long
Application.ScreenUpdating = False
lngLastRow = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row
Rows("2:" & lngLastRow).Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=AND(ISNUMBER($B2),$B2<10)"
Selection.FormatConditions(1).Interior.ColorIndex = 3
Application.ScreenUpdating = True
End Sub
--
If this post helps click Yes
---------------
Jacob Skaria


"pol" wrote:

This macro will work but the problem is it will take long time to work this
macros for large number of rows. Is it possible to give the rule of
conditional formating in a macros instead of using the loop.

Please let me know


"Jacob Skaria" wrote:

If you are really looking for a macro.... try below. Set the Security level
to low/medium in (Tools|Macro|Security). From workbook launch VBE using
short-key Alt+F11. From menu 'Insert' a module and paste the below code.
Save. Get back to Workbook. Run macro from Tools|Macro|Run <selected macro()

Sub Macro()
Dim lngRow As Long
Dim lngLastRow As Long
lngLastRow = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row
For lngRow = 2 To lngLastRow
If IsNumeric(Range("B" & lngRow)) Then
'If greater than 0 and less than 10
'If Range("B" & lngRow) < 10 Then
If Range("B" & lngRow) 0 And Range("B" & lngRow) < 10 Then
Rows(lngRow).Interior.ColorIndex = 3
End If
End If
Next
End Sub

--
If this post helps click Yes
---------------
Jacob Skaria


"pol" wrote:

Please let me know anybody , how I can write a macro for the mentioned
purpose. I need a sample macros.

Please with thanks

Pol

"JBeaucaire" wrote:

That's conditional formatting, and I suggest you NOT apply conditional
formatting to ENTIRE rows or the entire workbook. Just apply this answer far
enough out to the right to be practical...as far as your data goes and
perhaps a column or two further.

Anyway, highlight all the cells from A2 to whatever your last cell choice,
them click on FORMAT CONDITIONAL FORMATTING. Use this formula:

Condition1: Formula Is:
=AND(ISNUMBER($B2),$B2<10)
Format...Pattern...select a red color

Now any rows with a value in column B less than 10 will light up.
--
"Actually, I *am* a rocket scientist." -- JB

Your feedback is appreciated, click YES if this post helped you.


"pol" wrote:

Please let me help to give a colour for the entire row by certain condition
as follows

I have an excel sheet with the following column

A B
Code Qty

001 20
002 30
003 10
004 20
005 15
006 05

if in any of the cell in B is less than that of 10 , the back ground colour
of the entrire row of that cell having that condition = true should be in Red.

Please let me know

With thanks and Regards

Pol



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
formula to change back ground cell color according to a value JP Excel Discussion (Misc queries) 1 May 12th 08 03:02 AM
How do I put a back ground word on a sheet in Excell Scrapironmike Excel Discussion (Misc queries) 1 October 17th 07 07:10 AM
Excel spreadsheet change colour of cell back ground depending on d Nataliec Excel Discussion (Misc queries) 1 September 12th 07 12:12 PM
How to set a back ground picture in an exel file Divya Excel Worksheet Functions 2 June 30th 06 06:03 PM
back ground color doesn't work in cell. Soother Excel Worksheet Functions 1 October 7th 05 02:14 AM


All times are GMT +1. The time now is 09:21 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"