+ Reply to Thread
Results 1 to 7 of 7

Color Fill row

  1. #1
    Forum Contributor
    Join Date
    08-07-2013
    Location
    mo
    MS-Off Ver
    Excel 2010
    Posts
    453

    Color Fill row

    I need to color fill a row. The code below works, but if there are some blank cells in the row it stops. I need to fill until there last cell with data. There will be no more than 2 blacnk cells in a row.

    What can I add to this.


    Please Login or Register  to view this content.

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Color Fill row

    Which column has the last cell with data?
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Color Fill row

    Try change

    With Range(Cells(i, 3), Cells(i, Cells(i, 3).End(xlToRight).Column)).Interior

    to

    Range(Cells(i, 3), Cells(i, Columns.Count).End(xlToLeft)).Interior

    or perhaps

    With Range(Cells(i, 3), Cells(i, ActiveSheet.UsedRange.Columns.Count).Interior

  4. #4
    Forum Contributor
    Join Date
    08-07-2013
    Location
    mo
    MS-Off Ver
    Excel 2010
    Posts
    453

    Re: Color Fill row

    It is going to vary. Data will be from "C" to "K" but there may not bu data in "K" always so I would need it to color from "C" to the last cell with data which wont be past "K"

  5. #5
    Forum Contributor
    Join Date
    08-07-2013
    Location
    mo
    MS-Off Ver
    Excel 2010
    Posts
    453

    Re: Color Fill row

    The
    Please Login or Register  to view this content.
    worked. Thanks for the help

  6. #6
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Color Fill row

    Please Login or Register  to view this content.

  7. #7
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Color Fill row

    Quote Originally Posted by mattress58 View Post
    The
    Please Login or Register  to view this content.
    worked. Thanks for the help
    mattress58, glad it worked!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to color-fill blank cells, then once data is entered cell is no-fill
    By hatemail13 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-28-2013, 07:57 PM
  2. [SOLVED]Fill Color (highlight cells) but not to print fill color
    By itszille in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-24-2012, 05:37 PM
  3. Replies: 0
    Last Post: 09-26-2012, 01:08 PM
  4. Replies: 3
    Last Post: 07-08-2010, 06:48 PM
  5. Replies: 0
    Last Post: 04-06-2009, 04:07 PM

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