+ Reply to Thread
Results 1 to 3 of 3

Toggle Shading Alternate Rows On/Off

  1. #1
    Registered User
    Join Date
    05-04-2014
    Location
    Perth, Australia
    MS-Off Ver
    MS365
    Posts
    35

    Toggle Shading Alternate Rows On/Off

    Hi - I have 2 macros (below) that
    1. shades every other row in named range "CF_Range" with conditional formatting "=MOD(ROW(),2)=0"
    and inserts with top and bottom borders.
    2. the other short macro turns this shading (banding), and top & bottom borders, OFF.

    Q1 - can the macro be reduced at all? It was recorded so may contain some superfilous lines.
    Q2 - how do I incorporate these into the 1 macro so it toggles shading (banding) between ON and OFF?

    Tks

    Please Login or Register  to view this content.
    Last edited by anare; 09-21-2015 at 10:18 AM.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,659

    Re: Toggle Shading Alternate Rows On/Off

    One idea is to have a cell value toggle the stripping.

    This example CF formula uses cell A1 as the toggle cell. When A1 = 0, stripping is on. When A1 <> 0, stripping is off.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Edit the toggle cell and value to suit.

    If you need a macro to toggle the cell's value, try something like this...

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    05-04-2014
    Location
    Perth, Australia
    MS-Off Ver
    MS365
    Posts
    35

    Re: Toggle Shading Alternate Rows On/Off

    Brilliant! Thanks Alphafrog.

+ 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. Shading alternate groups, not rows?
    By A-Reading in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-22-2014, 11:54 AM
  2. [SOLVED] Shading Alternate Unhidden Rows in Excel
    By CrocHntr in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-06-2014, 09:01 AM
  3. [SOLVED] Alternate Shading Without Printing Blank Rows
    By Hazarrd in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-14-2013, 05:31 PM
  4. Alternate shading of range of rows when when sell value changes
    By libinxu in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-19-2012, 05:36 PM
  5. Alternate Shading (fill color) every three rows
    By jeaux11 in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 02-08-2008, 04:42 AM
  6. Replies: 2
    Last Post: 05-11-2007, 06:11 PM
  7. Replies: 8
    Last Post: 05-10-2006, 11:10 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