+ Reply to Thread
Results 1 to 3 of 3

Highlight every other row

  1. #1
    Registered User
    Join Date
    08-15-2009
    Location
    London, Engalnd
    MS-Off Ver
    Excel 2003
    Posts
    5

    Highlight every other row

    Hi all

    I have code that changes every other row, no problem.

    Question is what do you all do to run it.

    At moment I have it in the Sheet activate event. It scours the rows and changes the highlight of every other row so it is more readable.

    Trouble is for more than 5000 rows it slows down the app a bit and does not look very professional.

    I thought about a global variable that holds the last row, I could see if the last row has been incremented and only call the highlight procedure if it has been incremented but that just does not feel elegant.

    Any ideas ?

    Cheers all

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Highlight every other row

    See http://www.cpearson.com/excel/banding.aspx
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Highlight every other row

    Hi LuckyJim,

    A quick way, which doesn't involve macros or any manual work (and will auto-update when you delete/add rows) is to use Conditional Formatting. (I'm trying to recall the menu steps from memory, as I don't have 2003 any longer)

    For example:

    1. Select your entire sheet (click the square to the left of column header A, above row header 1)
    2. Click Format -> Conditional Formatting
    3. Select 'Formula Is...'
    4. In the textbox provided, put the formula: =MOD(ROW(),2)=1
    5. Click the Format button and set your Fill color
    6. Click OK twice and every other row should now be shaded that fill color.

    Hope that helps!

+ 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