+ Reply to Thread
Results 1 to 7 of 7

VBA to hide/unhide rows & columns on multiple sheets

  1. #1
    Registered User
    Join Date
    10-13-2015
    Location
    Seattle, WA
    MS-Off Ver
    2010 and 365
    Posts
    5

    VBA to hide/unhide rows & columns on multiple sheets

    Hi all,

    I have attached a file that represents what I am currently using to day and what I would like to accomplish.

    Currently, I have a macro in the input worksheet that will hide or unhide rows and columns within that worksheet.

    The worksheet currently works as a table where a user can input some age and salary information for four people. The user can select the term of the model from 1-7 years in cell D2 and columns E:K will hide/unhide depending on the term selected.

    There is an option for the user to add an additional person to the model by adding a name in cell C17, which will unhide rows 18 and 19 so the user can enter the age and salary for that person.

    I would like a way to have cell D2 and C17 hide/unhide rows and columns on the input tab and the results tab.


    The current code that I am using is:
    Please Login or Register  to view this content.

    Example file.xlsm


    Any help is greatly appreciated!

    thanks,
    Adam23

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: VBA to hide/unhide rows & columns on multiple sheets

    Change your original to this:-

    Please Login or Register  to view this content.

    Add these into a normal macro module

    Please Login or Register  to view this content.
    Last edited by mehmetcik; 10-14-2015 at 06:18 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    10-13-2015
    Location
    Seattle, WA
    MS-Off Ver
    2010 and 365
    Posts
    5

    Re: VBA to hide/unhide rows & columns on multiple sheets

    Thank you mehmetcik for your help with this!

    I'll give this a try and let you know the results!

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: VBA to hide/unhide rows & columns on multiple sheets

    Make sure you use the latest version.

    It is now fully debugged.

  5. #5
    Registered User
    Join Date
    10-13-2015
    Location
    Seattle, WA
    MS-Off Ver
    2010 and 365
    Posts
    5

    Re: VBA to hide/unhide rows & columns on multiple sheets

    Thanks again for your help with this, but can you please help me a little more...

    I have updated the code in the input worksheet to what you provided above and have created a module and added the second code that you provided.

    Do I need to edit any of the code to make it hide columns on the results worksheet as well? the columns are not hiding in that worksheet when I change the value in input!D2

    Right now, changing the value in input!D2 is only hiding columns on the input worksheet.

    Did I do something wrong?

    Your help is greatly appreciated.

    Thank you,
    Adam23

  6. #6
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: VBA to hide/unhide rows & columns on multiple sheets

    My Mistake. For got the +1

    Also you need to make sure the columns on the sheets that are to hide / unhide match or modify the code

    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    10-13-2015
    Location
    Seattle, WA
    MS-Off Ver
    2010 and 365
    Posts
    5

    Re: VBA to hide/unhide rows & columns on multiple sheets

    Works like a charm! Thank you for all your help!

+ 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. Hide/unhide rows & columns
    By wedzmer in forum Excel General
    Replies: 33
    Last Post: 07-01-2015, 03:49 AM
  2. [SOLVED] Hide and Unhide rows on multiple sheets based on a validation list on a single sheet
    By bbarth in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-30-2015, 02:10 PM
  3. [SOLVED] Better way to unhide/hide multiple sheets
    By groundin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-28-2013, 11:24 PM
  4. Hide/Unhide rows on multiple sheets when dropdown selected from sheet 1
    By tammhelp in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-02-2012, 10:33 PM
  5. Excel Hide/Unhide Rows/Columns
    By jregan in forum Excel General
    Replies: 4
    Last Post: 08-03-2010, 11:55 AM
  6. How to hide and unhide Rows & Columns
    By Aarif in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-23-2006, 01:25 AM
  7. [SOLVED] Hide / Unhide columns and rows
    By PaulM in forum Excel General
    Replies: 8
    Last Post: 12-12-2005, 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