+ Reply to Thread
Results 1 to 10 of 10

Hide Sheets Error

  1. #1
    Forum Contributor
    Join Date
    12-15-2019
    Location
    Not here
    MS-Off Ver
    2010
    Posts
    257

    Hide Sheets Error

    Hi,

    If I run the 'HideCalendarSheets()' when the sheets are already hidden it goes to debug. Is there a way to exit the code if the sheets are hidden?

    Thank you

    Please Login or Register  to view this content.

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Hide Sheets Error

    There are problems with using a Sheets object when some of the included sheets are hidden.
    You can solve that by hiding the same way that you un-hide, with

    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Hide Sheets Error

    .
    Another method. Did not include sheet 1 as there must be at least one sheet visible at all times.

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    12-15-2019
    Location
    Not here
    MS-Off Ver
    2010
    Posts
    257

    Re: Hide Sheets Error

    There are more sheets in the workbook that will always stay in view.

  5. #5
    Forum Contributor
    Join Date
    12-15-2019
    Location
    Not here
    MS-Off Ver
    2010
    Posts
    257

    Re: Hide Sheets Error

    I can't seem to get either one to work sorry.
    Last edited by crazyforexcel; 01-16-2020 at 06:05 PM.

  6. #6
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Hide Sheets Error

    Refer to the attached file.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    12-15-2019
    Location
    Not here
    MS-Off Ver
    2010
    Posts
    257

    Re: Hide Sheets Error

    Thanks Logit but the only sheets that I want to hide are 1-12 for the Calendar months.

  8. #8
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Hide Sheets Error

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    12-15-2019
    Location
    Not here
    MS-Off Ver
    2010
    Posts
    257

    Re: Hide Sheets Error

    That is perfect thanks for all of your help.

  10. #10
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Hide Sheets Error

    You are welcome.

+ 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. [SOLVED] VBA to Hide or Un Hide Multiple Particular sheets.
    By ahsan.masood1980 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-13-2020, 05:44 AM
  2. Hide sheets based on cell values - getting error
    By silentcarl in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-29-2016, 04:14 PM
  3. Hide Rows in most sheets skipping hidden sheets
    By NancyPez in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 02-11-2016, 04:53 PM
  4. Replies: 4
    Last Post: 11-28-2015, 02:15 PM
  5. Hide all sheets (very hidden) except one or Unhide all sheets with password
    By wmdriver in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-21-2015, 07:21 AM
  6. Press Save - Hide Sheets (before saving) - Actually Save - Unhide Sheets Again
    By MixedupExcel in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-28-2015, 07:22 AM
  7. Hide all sheets but selected sheets - an example
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-07-2006, 01:35 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