+ Reply to Thread
Results 1 to 2 of 2

Highlighting Macro

Hybrid View

  1. #1
    Registered User
    Join Date
    10-02-2009
    Location
    Arlington, VA, USA
    MS-Off Ver
    Excel 2003
    Posts
    34

    Highlighting Macro

    I needed to create a simple highlighting macro, but was not precisely sure how to go about it. I experimented around a little bit, but failed. Essentially, it would need to highlight every 14th row of data in yellow.

    So basically ... .

    14th row highlighted
    28th row highlighted
    42th row highlighted
    56th row highlighted
    70th row highlighted
    etc ...

    How would I go about doing this?

    Thanks ahead of time.

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Highlighting Macro

    Hi Try this

    Sub YellowRows()
        Dim i As long
    
        For i = 14 To Rows.Count Step 14
            Rows(i).Interior.ColorIndex = 6
        Next
    End Sub
    This will do the whole work sheet you might want to cut it down a little
    Last edited by Marcol; 03-10-2010 at 09:55 AM. Reason: changed integer to long

+ 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