+ Reply to Thread
Results 1 to 5 of 5

New to add color the blank row being added after group change.

  1. #1
    Registered User
    Join Date
    06-04-2014
    Posts
    3

    New to add color the blank row being added after group change.

    Good morning, I am very new to VBA and to this forum. I have searched but was not able to locate what I am after, so I will try to post for an answer.

    THe following formula is working to insert a blank row after a group change in my workbook, but I wish to enhance this by having the formula color fill that blank row as well.

    What do I need to add to this macro to accomplish this task?

    Thank you, Jim

    Sub AddBlankRows()
    '
    Dim iRow As Integer
    Range("a1").Select
    '
    iRow = 1
    '
    Do
    '
    If Cells(iRow + 1, 1) <> Cells(iRow, 1) Then
    Cells(iRow + 1, 1).EntireRow.Insert shift:=xlDown
    iRow = iRow + 2
    Else
    iRow = iRow + 1
    End If
    '
    Loop While Not Cells(iRow, 1).Text = ""
    '
    End Sub

  2. #2
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: New to add color the blank row being added after group change.

    This code adds yellow color to the new row added.
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    06-04-2014
    Posts
    3

    Re: New to add color the blank row being added after group change.

    It did add color, but only to the very first row, please see screen shot.

    untitled.JPG

    HOw can I get it to color fill all the blank rows?

    Thank you, JIm
    Last edited by Jimmyd48; 06-04-2014 at 01:13 PM. Reason: forgot to ask the next ?

  4. #4
    Registered User
    Join Date
    06-04-2014
    Posts
    3

    Re: New to add color the blank row being added after group change.

    Well, this does work, seems I just needed to run it in a new spreadsheet!

    Thanks for the help.

  5. #5
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: New to add color the blank row being added after group change.

    Update the thread as SOLVED. You may wish to add to my reputation.

+ 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. [SOLVED] Toggle fill Color in cell based on condition of cell--blank or text added.
    By moosetales in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-15-2014, 08:39 PM
  2. Replies: 28
    Last Post: 08-29-2013, 02:53 PM
  3. [SOLVED] Change color of text for a group of shapes
    By emiliekatherine in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-27-2012, 08:43 AM
  4. Change cell color if only if not blank
    By LaurenSmalley in forum Excel General
    Replies: 4
    Last Post: 02-04-2011, 03:06 PM
  5. Replies: 3
    Last Post: 10-19-2005, 10:05 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