+ Reply to Thread
Results 1 to 7 of 7

VBA code to change background color of a row in a spreadsheet

  1. #1
    Registered User
    Join Date
    06-15-2012
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2010
    Posts
    4

    VBA code to change background color of a row in a spreadsheet

    I am a complete beginner in using Excel, but was given this code to insert rows into a spreadsheet that I submit to my client on a weekly basis. The blank rows are used as separators between rows of data:

    Please Login or Register  to view this content.
    I also need to have these rows highlighted in light gray. The person who gave me this code can't find how to do this, so any help would be much appreciated! Thanks, Michelle

  2. #2
    Forum Contributor
    Join Date
    06-07-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    189

    Re: VBA code to change background color of a row in a spreadsheet

    Try

    Please Login or Register  to view this content.

  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: VBA code to change background color of a row in a spreadsheet

    Or another version
    Please Login or Register  to view this content.
    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
    Registered User
    Join Date
    06-15-2012
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: VBA code to change background color of a row in a spreadsheet

    Thank you! This worked perfectly! Can I also ask, do you know how I set the parameters for which columns I wish to highlight? Currently the rows are being highlighted past column P, which is where my spreadsheet ends. So I would like to just highlight A:P.

    Thanks again, Michelle

  5. #5
    Registered User
    Join Date
    06-15-2012
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: VBA code to change background color of a row in a spreadsheet

    Thank you as well: I tried this code and it works too! Much appreciated: do you know how to set column parameters, so that I am only applying this code to columns A:P? Thanks, Michelle

  6. #6
    Forum Contributor
    Join Date
    06-07-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    189

    Re: VBA code to change background color of a row in a spreadsheet

    Try

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    06-15-2012
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: VBA code to change background color of a row in a spreadsheet

    Once again, thanks! This is perfect and you've saved us hours of work. Michelle

+ 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