+ Reply to Thread
Results 1 to 12 of 12

Set of Conditional Formatting rules for whole column

  1. #1
    Forum Contributor
    Join Date
    07-20-2007
    MS-Off Ver
    2016, 365
    Posts
    127

    Set of Conditional Formatting rules for whole column

    Hi All.
    I have spreadsheet where one of the column has validate data drop down list with some items in each row of the column. For each item value of drop down list I created condition formatting rule like that
    ConditionFormatting.png
    Does exists simple way to copy and paste rules of condition formatting to each row of the column or do I need to create set of rules for each drop down list for each row? If it is possible. I will appreciate if someone will explain how it to do. If it is possible in VBA show code how it to do.

    Thanks
    Last edited by eugz; 05-01-2022 at 02:53 PM.

  2. #2
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483

    Re: Set of Conditional Formatting rules for whole column

    in the Rule formula remove the $ between C and 3 so $C3

    in the apply to just change the rownumber of G column to f.e. 3000

    with the changed rule it will automaticly move a row down for validationrule
    make sure the formula starts at same row as your apply to range.

    see if you can change it yourself based on my description or upload an example file so I can show it in there.

    als read up on absolute an relative cell references that will explain you the use of the $ signs

  3. #3
    Forum Contributor
    Join Date
    07-20-2007
    MS-Off Ver
    2016, 365
    Posts
    127

    Re: Set of Conditional Formatting rules for whole column

    Hi Roel Jongman. Thanks for reply.
    I attached my file and I will appreciate if you show on it how it to do.

    Thanks
    Attached Files Attached Files
    Last edited by eugz; 05-01-2022 at 04:58 PM.

  4. #4
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483

    Re: Set of Conditional Formatting rules for whole column

    Sure,

    have a look at the endresult.

    - you need $ before C to make sure the validation rule only looks at column C and does not move over.
    - you need to remove $ before 3 to make sure it test the row it is on.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    07-20-2007
    MS-Off Ver
    2016, 365
    Posts
    127

    Re: Set of Conditional Formatting rules for whole column

    Thank you very much. Just one more question. Can you give me a link and/or suggest a book to read about absolute an relative cell references.

    Thanks

  6. #6
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483

    Re: Set of Conditional Formatting rules for whole column


  7. #7
    Forum Contributor
    Join Date
    07-20-2007
    MS-Off Ver
    2016, 365
    Posts
    127

    Re: Set of Conditional Formatting rules for whole column

    Hi Roel Jongman
    In file that I attached has Reset button. How to code YesNo dialog message box for that code?

    Thanks
    Last edited by eugz; 05-02-2022 at 02:05 PM.

  8. #8
    Valued Forum Contributor
    Join Date
    10-12-2021
    Location
    CT
    MS-Off Ver
    365
    Posts
    462

    Re: Set of Conditional Formatting rules for whole column

    You can't check if an entire range is blank by the way you wrote it but you can set an entire range = to nothing (code#2 that you wrote). The code below will do what you're looking for:
    Please Login or Register  to view this content.
    *modified @ 2:07 pm.
    Last edited by carlmon; 05-02-2022 at 02:08 PM.

  9. #9
    Forum Contributor
    Join Date
    07-20-2007
    MS-Off Ver
    2016, 365
    Posts
    127

    Re: Set of Conditional Formatting rules for whole column

    Hi carlmon. Thanks for reply.
    When I run code first time it didn't work and no error. I add to second IF statement
    Please Login or Register  to view this content.
    and substitute If n = 0 Then to If n > 0 Then. But it Reset spreadsheet when I click Yes and reset when I click No. How to fix the problem?

    Thanks

  10. #10
    Valued Forum Contributor
    Join Date
    10-12-2021
    Location
    CT
    MS-Off Ver
    365
    Posts
    462

    Re: Set of Conditional Formatting rules for whole column

    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    07-20-2007
    MS-Off Ver
    2016, 365
    Posts
    127

    Re: Set of Conditional Formatting rules for whole column

    I debugged step by step. When I clicked button N=2 after loop For. May be need to say If n > 0 Then?

    Thanks

  12. #12
    Valued Forum Contributor
    Join Date
    10-12-2021
    Location
    CT
    MS-Off Ver
    365
    Posts
    462

    Re: Set of Conditional Formatting rules for whole column

    Eugz, the idea with the N = N+1 was to say if there are no values in this range, N will = 0... if N = 0, then the message box will appear.

    It looks like you deleted your original code, but you had the idea of... if this range is "" then show this message box.

    By setting N>0, then you are effectively saying if this range isn't blank, then show the message box.

+ 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. Conditional Formatting Rules
    By cyliyu in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-12-2019, 12:36 AM
  2. [SOLVED] Conditional Formatting - 2 rules in 1
    By Leathermyth in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-19-2015, 02:29 PM
  3. Conditional Formatting two rules
    By pauldaddyadams in forum Excel General
    Replies: 1
    Last Post: 11-21-2014, 11:15 AM
  4. Conditional formatting rules
    By puzzlelover22 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-01-2014, 12:45 PM
  5. conditional formatting rules for a cell on sheet 1 based on rules from sheet 2
    By jsard in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 1
    Last Post: 08-15-2013, 09:22 AM
  6. [SOLVED] Conditional Formatting: Comparing cell with a column of values and applying 3 rules
    By ab231 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-02-2013, 10:30 AM
  7. Conditional Formatting with more than 3 rules
    By vickyho1008 in forum Excel General
    Replies: 5
    Last Post: 07-24-2008, 10:06 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