+ Reply to Thread
Results 1 to 8 of 8

How to highlight every second row?

  1. #1
    Forum Contributor
    Join Date
    05-10-2011
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    145

    How to highlight every second row?

    Hi,
    I would like to highlight rows (on selected cells) like a Zebra, so that every other row will get a different background color.
    I need a macro solution.

    Please see sample attached...

    Any idea how to do this?
    Attached Files Attached Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,411

    Re: How to highlight every second row?

    No need for a macro - use conditional formatting with a formula like this:

    =MOD(ROW(),2)=1

    for one colour and the other colour set as a standard fill.

    Hope this helps.

    Pete

  3. #3
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: How to highlight every second row?

    Do you want any 2 colors or the 2 in the file?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,411

    Re: How to highlight every second row?

    @sami770

    I see that you have Excel 2003 in your profile, yet you posted an .xlsx file. Please update your profile if you have a later version of Excel.

    Pete

  5. #5
    Forum Contributor
    Join Date
    05-10-2011
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    145

    Re: How to highlight every second row?

    Thanks, you helped me a lot!
    Also, I fix my profile ;-)


    Quote Originally Posted by Pete_UK View Post
    @sami770

    I see that you have Excel 2003 in your profile, yet you posted an .xlsx file. Please update your profile if you have a later version of Excel.

    Pete

  6. #6
    Forum Contributor
    Join Date
    05-10-2011
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    145

    Re: How to highlight every second row?

    It's ok now, Pete's solution worked for me
    Thanks!
    Quote Originally Posted by arlu1201 View Post
    Do you want any 2 colors or the 2 in the file?

  7. #7
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: How to highlight every second row?

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  8. #8
    Forum Contributor
    Join Date
    05-10-2011
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    145

    Re: How to highlight every second row?

    OK, done!
    Thanks!

    Quote Originally Posted by arlu1201 View Post
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1