+ Reply to Thread
Results 1 to 3 of 3

Conditional formatting and filters

  1. #1
    Registered User
    Join Date
    03-26-2007
    Posts
    92

    Conditional formatting and filters

    I have a conditional format that shades every other row: =MOD(ROW(),2)=0. Is it possilbe, once data is filtered, for this format to apply to the filtered data?

    Thanks!

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885
    From a post by Debra Dalgleish in 2003 (http://groups.google.com/group/micro...b5a33babb846):

    ========================================================
    You can do this if you add a helper column to the table:

    1. Insert a blank column (column A in this example)
    2. Add a heading, e.g. Count
    3. In row 2, enter the following formula, where column B
    contains no blank cells within the table range:
    =SUBTOTAL(3,$B$2:$B2)
    4. Copy the formula down to all rows of data
    5. Select the worksheet
    6. Choose Format>Conditional Formatting
    7. Choose Formula Is
    8. In the formula box, type:
    =AND($A1<>"",MOD($A1,2)=0)
    9. Click the Format button, and select a colour for the shaded rows
    10. Click OK, click OK

    Filter the table, the count will change, and alternate rows will be shaded.
    ========================================================

    I tested it myself and it seems to work, hopefully it does for you. (You can hide the helper column, too.)

  3. #3
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    Use a helper column. Enter this in say B1 and drag down.

    =MOD(SUBTOTAL(3,$A$1:$A1),2)


    Then do your CF on the 1's or 0's

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

+ 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