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

Hi,

Can someone help me out with the following problem:

In comlumn A the macro has to look for the value "0".
Everytime this value is found this row and the row below have to be
coloured.

Someone?

Thank in advance.

Bernd
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default color multiple rows

Hi

Try this:

Sub ColorRows()
FirstRow = 1
LastRow = Range("A" & Rows.Count).End(xlUp).Row
For r = FirstRow To LastRow
If Cells(r, "A").Value = "0" Then
Rows(r).Resize(2).Interior.ColorIndex = 6
End If
Next
End Sub

Best regards,
Per

On 28 Apr., 15:43, bernd wrote:
Hi,

Can someone help me out with the following problem:

In comlumn A the macro has to look for the value "0".
Everytime this value is found this row and the row below have to be
coloured.

Someone?

Thank in advance.

Bernd


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

This is exactly how I meant it.

Thank you Per!
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
Counting characters in multiple rows when rows meet specific criteria news.virginmedia.com Excel Worksheet Functions 3 June 28th 08 09:03 PM
Color alternate rows when after hiding selected rows Monk[_2_] Excel Worksheet Functions 6 June 7th 08 01:36 AM
How do I sort my data by color? (color applied to rows) TTownsend Excel Worksheet Functions 3 September 7th 06 09:49 PM
Copying multiple rows to other worksheets (but amount of rows varies) - How? David Smithz Excel Discussion (Misc queries) 1 June 18th 06 04:31 PM
Find all rows of a color and copy those rows to a new worksheet hshayh0rn Excel Programming 3 May 26th 06 08:34 PM


All times are GMT +1. The time now is 06:02 AM.

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"