Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default highlighting rows

Hello,

I woudl like to write a macro that highlights rows if cell values in
columns m,n, and o ALL = zero.

Thanks,
Amanda
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default highlighting rows

Right click sheet tab, view code paste this in and run it

Sub copyit()
Dim MyRange As Range
lastrow = Cells(Rows.Count, "M").End(xlUp).Row
Set MyRange = Sheets("Sheet1").Range("M1:M" & lastrow)
For Each c In MyRange
If c.Value = "zero" And c.Offset(0, 1).Value = "zero" _
And c.Offset(0, 2).Value = "zero" Then
c.EntireRow.Interior.ColorIndex = 3
End If
Next
End Sub

Mike

"amanda" wrote:

Hello,

I woudl like to write a macro that highlights rows if cell values in
columns m,n, and o ALL = zero.

Thanks,
Amanda

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default highlighting rows

On Feb 7, 11:46*pm, amanda wrote:
Hello,

I woudl like to write a macro that highlights rows if cell values in
columns m,n, and o ALL = zero.

Thanks,
Amanda


Hi Amanda,
Why use a macro, when conditional formatting helps in this case?
Cheers,
Tausif
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
Highlighting Rows with VB. Xman Excel Worksheet Functions 12 January 23rd 09 12:48 PM
Highlighting Rows Lynda Excel Discussion (Misc queries) 0 August 29th 07 07:26 AM
Highlighting Rows Bert Excel Discussion (Misc queries) 1 November 8th 06 06:39 PM
Highlighting rows? Linn Kubler Setting up and Configuration of Excel 4 November 12th 05 05:55 PM
highlighting rows [email protected] Excel Programming 1 May 28th 04 02:58 AM


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