+ Reply to Thread
Results 1 to 6 of 6

Check Box - (Hide / Unhide worksheet)

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    09-09-2008
    Location
    Middlesbrough, England
    MS-Off Ver
    2007
    Posts
    174

    Check Box - (Hide / Unhide worksheet)

    Hi,

    I have 2 worksheets (January & February).

    If you check the box "Show February", i would like to do the following actions:

    *Un tick the "Show February" then hide the "January" tab and unhide the "February" tab and select cell A1.

    Attached is a sample file.
    Attached Files Attached Files

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Check Box - (Hide / Unhide worksheet)

    Something like this?(for the first part). If yes we'll do the other one too.
    Private Sub CheckBox1_Click()
    Sheets("February").Select
        ActiveWindow.SelectedSheets.Visible = False
       Sheets("January").Range("A1").Select
    End Sub
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Forum Contributor
    Join Date
    09-09-2008
    Location
    Middlesbrough, England
    MS-Off Ver
    2007
    Posts
    174

    Re: Check Box - (Hide / Unhide worksheet)

    Ive tried the following:

    Private Sub Checkbox1_Click()
    
    If Checkbox1.Value = True Then
    Application.ScreenUpdating = False
    Sheet2.Visible = xlSheetVisible
    Sheet1.Visible = xlSheetHidden
    Sheets("sheet2").Activate
    Else
    Sheet2.Visible = xlSheetHidden
    Application.ScreenUpdating = True
    End If
    
    End Sub

    How do i add uncheck the box once the above action has been completed?
    Last edited by batchy; 02-20-2014 at 09:01 AM.

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Check Box - (Hide / Unhide worksheet)

    This is my best.

    Private Sub CheckBox1_Click()
    Sheets("January").Select
        Sheets("February").Visible = True
        Range("A1").Select
       Sheets("January").Visible = False
       
    End Sub
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    09-09-2008
    Location
    Middlesbrough, England
    MS-Off Ver
    2007
    Posts
    174

    Re: Check Box - (Hide / Unhide worksheet)

    I have resolved this by doing the following:

    Private Sub Checkbox1_Click()
    
    If Checkbox1.Value = True Then
    Application.ScreenUpdating = False
    Sheet2.Visible = xlSheetVisible
    Sheet1.Visible = xlSheetHidden
    Sheet2.Activate
    sheet1.Checkbox1.value = False
    Else
    Sheet2.Visible = xlSheetHidden
    Application.ScreenUpdating = True
    End If
    
    End Sub

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Check Box - (Hide / Unhide worksheet)

    Well done!

    thanks for the feed back.

    As that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED,as per Forum Rule #9. Thank you.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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. Using check boxes to hide and unhide worksheets
    By J_barber in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-12-2017, 04:27 AM
  2. check box hide or unhide rows/column
    By makhdoomliaqat in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-28-2013, 08:15 AM
  3. Hide/unhide row using check box ***PLEASE HELP***
    By madaleck1 in forum Excel General
    Replies: 6
    Last Post: 09-22-2011, 02:31 PM
  4. Excel 2007 : Hide/Unhide blank rows assigned to a check-box
    By Prof-pat-pending in forum Excel General
    Replies: 10
    Last Post: 09-05-2009, 03:50 AM
  5. Check Box Macro to hide and unhide a column
    By Daphne in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-26-2006, 08:55 AM

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