+ Reply to Thread
Results 1 to 8 of 8

Greying out of Rows and Conditional Displaying of Rows

  1. #1
    Registered User
    Join Date
    05-02-2022
    Location
    East Coast, USA
    MS-Off Ver
    365
    Posts
    5

    Greying out of Rows and Conditional Displaying of Rows

    Hi everyone,

    I hope this email finds you well! I have a spreadsheet that I'm trying to insert two (2) types of functions into:

    1-I would like the ability to define a range of categories in a column (example: A2:A15) and if 3 values are present in a row in that range (Example: Rows 3, 8, 9), then all remaining rows in that section are greyed out (in this example, row 2, 4-7,9-15).

    2-I would also like the ability to have hidden rows displayed if I insert a specific value into a cell elsewhere in the sheet. For example, if I insert the text value (not case specific) of A, B, or C into a cell, then rows 100, 101, and 102 are displayed.

    Another element of the greying and/or displaying rows would be the parameters of the rows would be constrained within a column range. So, utilizing the first example, instead of it being row 2, it would be A2:I2, A4:I4 and so on.

    I am a beginner with VBA and so I may need a bit of patience, but thanks in advance!

  2. #2
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Greying out of Rows and Conditional Displaying of Rows

    Hey there,

    I've read this post a few times but I'm still not 100% clear on what you want. I don't think it's difficult but there is ambiguity in what you're asking for and I think that's why you haven't had any responses yet.

    1-I would like the ability to define a range of categories in a column (example: A2:A15) and if 3 values are present in a row in that range (Example: Rows 3, 8, 9), then all remaining rows in that section are greyed out (in this example, row 2, 4-7,9-15).
    Questions:
    a. Where do you want to define the range - in code or elsewhere?
    b. Where are you defining the "3 values" - in code or elsewhere?
    c. Is it the same value 3 times or 3 different values?

    2-I would also like the ability to have hidden rows displayed if I insert a specific value into a cell elsewhere in the sheet. For example, if I insert the text value (not case specific) of A, B, or C into a cell, then rows 100, 101, and 102 are displayed.
    Questions:
    a. Which cell elsewhere in the sheet?
    b. Is it just "A, B, or C" or are there other values?
    c. Which rows exactly should be hidden?

    The best approach here is to prepare a workbook showing exactly what's going to be entered (e.g. on Sheet1) and then showing exactly what you'd like to get as a result (e.g. on Sheet2).

    WBD
    Office 365 on Windows 11, looking for rep!

  3. #3
    Registered User
    Join Date
    05-02-2022
    Location
    East Coast, USA
    MS-Off Ver
    365
    Posts
    5

    Re: Greying out of Rows and Conditional Displaying of Rows

    hi wideboydixon
    Here are answers and a sample spreadsheet:
    1st set:
    A) defining range can be in code or wherever it makes sense. whatever is simplest is probably best.
    B) similar to the range, the values can be defined in code or wherever makes sense.
    C) there are other values; i created a dropdown with about 6 values. However, I wanted to have the option (in terms of the functionality here) to place any value in the cells to initiate the response.

    2nd set:
    A) the cell elsewhere on the sheet is part of a dropdown column where users will insert data. in the example attached, it's the 'grade dropdown' column.
    B) there are other values; i created a dropdown with about 6 values. However, I wanted to have the option (in terms of the functionality here) to place any value in the cells to initiate the response.
    C) in my example sheet, A17:E17 and A18:E18 are the rows that would be hidden.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    05-02-2022
    Location
    East Coast, USA
    MS-Off Ver
    365
    Posts
    5

    Re: Greying out of Rows and Conditional Displaying of Rows

    the column reference for the first set is d2:d16

  5. #5
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Greying out of Rows and Conditional Displaying of Rows

    OK. Right click the sheet name and select "View Code". Then paste in this code:

    Please Login or Register  to view this content.
    Is that the kind of thing you're after? Rows 17/18 are only shown when D2 contains "A".

    WBD

  6. #6
    Registered User
    Join Date
    05-02-2022
    Location
    East Coast, USA
    MS-Off Ver
    365
    Posts
    5

    Re: Greying out of Rows and Conditional Displaying of Rows

    OK, thank you and thanks for your patience.
    To be sure, to apply this, I will need to go to the developer menu and add a module using VBA? or are you identifying another way to make this happen?

  7. #7
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Greying out of Rows and Conditional Displaying of Rows

    It was in my previous post. If you right click the sheet tab at the bottom, then select "View Code", you can paste the code above into the worksheet-specific module.

    WBD

  8. #8
    Registered User
    Join Date
    05-02-2022
    Location
    East Coast, USA
    MS-Off Ver
    365
    Posts
    5

    Re: Greying out of Rows and Conditional Displaying of Rows

    Thanks a ton! I really appreciate your help. I'm trying it out now.

+ 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 on Pivot Rows - Not Applying to all rows
    By Beefhamburger in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 01-11-2022, 12:29 PM
  2. Replies: 3
    Last Post: 07-01-2020, 10:15 AM
  3. Replies: 1
    Last Post: 05-23-2016, 01:53 PM
  4. Displaying multiple rows
    By covershaker in forum Excel General
    Replies: 1
    Last Post: 05-13-2015, 10:41 AM
  5. Displaying Multiple rows
    By covershaker in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-13-2015, 09:49 AM
  6. [SOLVED] Displaying all rows, printing only certain rows
    By GLT in forum Excel General
    Replies: 3
    Last Post: 11-22-2005, 11:40 AM
  7. Displaying Combinations of Rows
    By George B in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-14-2005, 07:10 PM

Tags for this Thread

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