+ Reply to Thread
Results 1 to 7 of 7

How to hide tabs, make them appear after specific user input

  1. #1
    Registered User
    Join Date
    07-10-2014
    Location
    Scotland
    MS-Off Ver
    MS Office 2010
    Posts
    19

    How to hide tabs, make them appear after specific user input

    Hi,

    I posted earlier, but since have made some good progress and figured some stuff out by myself!

    I have nearly finished my project, but need to make the last real bit of code, then just some general tidying up.


    What I want to do
    - I currently have two tabs in a userform - one called 'main' and one called 'extra'.
    - I want Main to always be shown to the user.
    - I want Extra to be hidden (is it possible to make the tabs invisible?) and for this form to be shown only under a specific condition

    I have a question on my userform (using Option Buttons):
    "Did the customer ask about an extra product today?"

    If the answer to this question is no
    - When the user hits the command button (after filling out the rest of the form), do nothing special - just return all the values to the worksheet

    If the answer is yes
    - When the user hits the command button, I want them to be taken to the 'extra' tab. They will fill out some additional check-boxes, then hit another command box, which will return the info from both the 'main' and 'extra' sheets into the same row of the worksheet.


    In brief: I want my 'extra' tab to be hidden, only to appear when 'yes' is selected, and for the results all to go back to the worksheet.

    Can this be done?
    Thank you for your help :D
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: How to hide tabs, make them appear after specific user input

    Google, MSGBOX vba

    and i googled, hiding pages on tab control, got this.

    http://answers.microsoft.com/en-us/o...c-64fa2ece7aa4
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Registered User
    Join Date
    07-10-2014
    Location
    Scotland
    MS-Off Ver
    MS Office 2010
    Posts
    19

    Re: How to hide tabs, make them appear after specific user input

    Quote Originally Posted by nathansav View Post
    and i googled, hiding pages on tab control, got this.
    http://answers.microsoft.com/en-us/o...c-64fa2ece7aa4
    Thank you for quick response and the link.

    However, the answers on that thread do not tell me how to do exactly what I require, only how to hide a control tab.

  4. #4
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: How to hide tabs, make them appear after specific user input

    Me.tabMyTabControl.Pages(0).Visible = False

    that should do it, in the section marked Answer.

  5. #5
    Registered User
    Join Date
    07-10-2014
    Location
    Scotland
    MS-Off Ver
    MS Office 2010
    Posts
    19

    Re: How to hide tabs, make them appear after specific user input

    I can hide the tab easily -- all you need to do is change the properties of the multipage to : "Style: fmTabStyleNone.

    This removes the tabs, which is great.

    Now I just need my command button to send my users to the now hidden 'Extra' tab, if they have chosen 'yes' to my specific question. Any ideas?

  6. #6
    Registered User
    Join Date
    06-18-2014
    Location
    Dallas, Texas
    MS-Off Ver
    Home and Business 2010
    Posts
    84

    Re: How to hide tabs, make them appear after specific user input

    If your userform places the value of "YES" in a specific cell you could use an IF statement to refer directly to the cell and the result being the sheet being unhidden. For example
    Please Login or Register  to view this content.
    This assumes your sheet is already hidden

  7. #7
    Registered User
    Join Date
    07-10-2014
    Location
    Scotland
    MS-Off Ver
    MS Office 2010
    Posts
    19

    Re: How to hide tabs, make them appear after specific user input

    What I have done is made the two tabs invisible on my userform by changing the style properties.

    Now, I just need the right code to get my command button to send the user to the hidden tab, if they select yes. Here's what I've tried, but it doesn't work:


    Please Login or Register  to view this content.

+ 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. Macro to insert one row into defined tabs based on user input
    By lexxasp1210 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-12-2013, 01:45 PM
  2. [SOLVED] Hyperlink to Hidden tabs then hide again after completed data input.
    By Toli in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 08-22-2012, 07:31 PM
  3. VBA to hide group of specific tabs
    By deucejmp in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-22-2011, 09:48 PM
  4. Hide specific tabs and password protect
    By dawnmau in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-29-2010, 12:23 PM
  5. [SOLVED] Detecting Ctrl-Tabs in User Form input fields?
    By Don Wiss in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-22-2005, 10:25 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