+ Reply to Thread
Results 1 to 4 of 4

Hide or show multiple named ranges of rows

  1. #1
    Registered User
    Join Date
    04-22-2016
    Location
    Belgium
    MS-Off Ver
    2010
    Posts
    22

    Hide or show multiple named ranges of rows

    Dear all,
    I'm newbie with VBA, so I'm sure that the code below can be improved to do what I describe below, but I can't find. I'm sure you experts can help

    My workbook contains 3 tabs.
    First tab serves to select criteria. Depending on the criteria selected by the user, there are three possible cases (A,B,C)
    depending on the cases, rows in each sheet are hidden or shown and some rows show a predefined text.

    What I want to do is the following:
    • Is it possible to name the ranges (for example to call rows 1 to 40 "experience", 41 to 44 "training" and so on) and to indicate the rows range name instead of the row numbers? otherwise I have to modify multiple lines whenever I insert new rows in the Sheets.
    • Moreover, after a case is selected, I would want that, depending on the answer to a question, some rows can also be hidden or shown.
      For example, case A shows rows 45 to 120 in sheet "MySheet1". If the user answers "Yes" to a question in cell B50 of "MySheet1, rows 51 to 65 are also hidden.

    Thanks for any help!

    Please Login or Register  to view this content.
    Last edited by missbogota; 02-11-2017 at 06:27 AM.

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Hide or show multiple named ranges of rows

    A while ago I did something smilar for someone else so if you post an example workbook with some named ranges I'm sure we can get it working.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Registered User
    Join Date
    04-22-2016
    Location
    Belgium
    MS-Off Ver
    2010
    Posts
    22
    Thanks for the reply.
    the workbook I'm working on contains personal data, so I can't send the original, but I made an example workbook with the same type of code
    Attached Files Attached Files

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Hide or show multiple named ranges of rows

    Did it for case A so you can see how it works. You can expand it yourself later on.
    Attached Files Attached Files

+ 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. Named Ranges don't show up in drop-down list
    By hds in forum Excel General
    Replies: 15
    Last Post: 10-16-2018, 06:26 PM
  2. [SOLVED] Add two Dynamic Named Ranges in userform combobox1. Show values on label1 from combobox se
    By svgopalareddy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-18-2015, 10:54 AM
  3. [SOLVED] Show/hide rows based on drop down cell using named ranges
    By Stu091074 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-07-2014, 11:00 AM
  4. [SOLVED] Easy way to show named ranges
    By DRFILL in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-15-2012, 04:33 AM
  5. Replies: 0
    Last Post: 10-15-2012, 07:24 AM
  6. [SOLVED] Chart+named ranges: undesired points show up at y=0 - problem
    By Alexander_Golinsky in forum Excel General
    Replies: 2
    Last Post: 07-09-2012, 08:29 AM
  7. Toggle Hide/ Show Named Ranges
    By jordan2322 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-11-2012, 06:33 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