+ Reply to Thread
Results 1 to 5 of 5

VBA Row Formatting (2 rows at a time)

  1. #1
    Registered User
    Join Date
    11-11-2009
    Location
    Chester, England
    MS-Off Ver
    Excel 2016
    Posts
    38

    VBA Row Formatting (2 rows at a time)

    So I'm a bit stuck on this :D

    I need to have a range coloured by 2 colours, each covering 2 rows. So row 1-2 should be green for example, and rows 3-4 should be blue, then 5-6 should be green etc

    I can do the alternating rows no bother, but having 2 seems to be tricky (might just be me!)

    So for example I have

    Please Login or Register  to view this content.
    I'm sure it's something simple, just having a senior moment

  2. #2
    Valued Forum Contributor
    Join Date
    11-02-2016
    Location
    NY
    MS-Off Ver
    2010
    Posts
    459

    Re: VBA Row Formatting (2 rows at a time)

    Once you have the 4 (total rows colored) rows...you can Copy Format down in Multiple of 4s.
    So if you have rows 3& 4 as BLUE and then rows 5 & 6 as GREEN, highlight rows 3~6, Copy format in multiples of 4 (Ex. 4, 8, 12, 16, 20, 400, 404, 408 etc). if you want to copy those 4 colors, highlight rows 3~6, copy format (Edit Paste Special as Formats) from Row 7 to Row 66 (60 rows)...it will format as you wish for those 60 rows. I call it the "Rule of Multiples!" when copying

  3. #3
    Registered User
    Join Date
    11-11-2009
    Location
    Chester, England
    MS-Off Ver
    Excel 2016
    Posts
    38

    Re: VBA Row Formatting (2 rows at a time)

    Fair enough, but I need to do this in VBA. The range is variable.
    Last edited by AliGW; 11-08-2017 at 04:12 AM. Reason: Unnecessary quotation removed.

  4. #4
    Registered User
    Join Date
    11-11-2009
    Location
    Chester, England
    MS-Off Ver
    Excel 2016
    Posts
    38

    Re: VBA Row Formatting (2 rows at a time)

    Anyone any other ideas?

  5. #5
    Registered User
    Join Date
    11-11-2009
    Location
    Chester, England
    MS-Off Ver
    Excel 2016
    Posts
    38

    Re: VBA Row Formatting (2 rows at a time)

    Well due to the overwhelming response, I've managed to figure out an automated solution.

+ 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. Replies: 3
    Last Post: 10-14-2014, 09:24 AM
  2. Time Formatting - Not able to sum up the time when converted to text format.
    By sagarshinde01 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-08-2013, 11:38 AM
  3. Formatting a total time entry and building a cumulative time formula.
    By TMc10 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-16-2012, 10:26 PM
  4. Replies: 3
    Last Post: 11-06-2012, 01:37 AM
  5. Replies: 6
    Last Post: 02-06-2012, 12:25 PM
  6. Replies: 4
    Last Post: 01-11-2012, 07:59 PM
  7. Conditional formatting two rows at a time
    By Mike K in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-12-2005, 07: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