+ Reply to Thread
Results 1 to 21 of 21

Hidden pages pop up out of no where!!!

Hybrid View

  1. #1
    Registered User
    Join Date
    11-06-2015
    Location
    San Diego
    MS-Off Ver
    2013
    Posts
    82

    Hidden pages pop up out of no where!!!

    Hi guys,
    So I have like a 15 sheet workbook and all the pages are hidden except for 1 configuration page and based of what you input on the configuration page I have a macro that will unhide the pages you need. No user will need more than say 17 pages at 1 time. However once I run the macro the pages I want unhide themselves yet when I make any change to any cell on a sheet that effects a cell on another sheet say through a formula basically all other sheets in the whole workbook randomly appear on that page in like a huge mixed up mess of other pages its very strange. This happen on every page I change a cell on and it makes using the model basically impossible. This only occurs after I run the macro and until I exist the workbook. I Turned screen updates off in the macro but nothing changed. I will attach the code below. Any help is appreciated.
    Thank you so much,
    Your friend.

  2. #2
    Registered User
    Join Date
    11-06-2015
    Location
    San Diego
    MS-Off Ver
    2013
    Posts
    82

    Re: Hidden pages pop up out of no where!!!

    Sub unhideforanalysis()
    '
    
    Dim cc As Worksheet: Set cc = Sheets("Read Prior to use")
    Dim rng As Range, c As Range
    Dim p As Range
    Application.ScreenUpdating = False ' Turn-off screen updates
           
    If cc.Range("J24") Like "*MSI*" Then
     Sheets("Read Prior to use").Select
        Sheets("simple ROI").Visible = True
        Sheets("simple ROI").Select
        Sheets("Inputs explained").Visible = True
        Sheets("Inputs explained").Select
        Sheets("Input").Visible = True
        Sheets("Input").Select
        Sheets("Analysis-Page").Visible = True
        Sheets("Analysis-Page").Select
        Sheets("Reports-Page").Visible = True
        Sheets("Reports-Page").Select
        Sheets("ROI-Page").Visible = True
        Sheets("ROI-Page").Select
        Sheets("Summary-Page").Visible = True
        Sheets("Summary-Page").Select
        Sheets("Analysis-Roll").Visible = True
        Sheets("Analysis-Roll").Select
        Sheets("Reports-Rolls").Visible = True
        Sheets("Reports-Rolls").Select
        Sheets("ROI-Roll").Visible = True
        Sheets("ROI-Roll").Select
        Sheets("Summary-Roll").Visible = True
        Sheets("Summary-Roll").Select
        Sheets("Analysis-MSI").Visible = True
        Sheets("Analysis-MSI").Select
        Sheets("Reports-MSI").Visible = True
        Sheets("Reports-MSI").Select
        Sheets("ROI-MSI").Visible = True
        Sheets("ROI-MSI").Select
        Sheets("Summary-MSI").Visible = True
        Sheets("Summary-MSI").Select
        Sheets("paper calculator").Visible = True
        Sheets("paper calculator").Select
        Sheets("Labor").Visible = True
        Sheets("Labor").Select
        Sheets("Fluids").Visible = True
        Sheets("Fluids").Select
        Sheets("Consumables").Visible = True
        Sheets("Consumables").Select
        Sheets("Primer Calculator").Visible = True
        Sheets("Primer Calculator").Select
        Sheets("Lookups").Visible = True
        Sheets("Lookups").Select
        Sheets("Currency Table").Visible = True
       Sheets("simple ROI").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Inputs explained").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Input").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Analysis-Page").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Reports-Page").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("ROI-Page").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Summary-Page").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Analysis-Roll").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Reports-Rolls").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Summary-Roll").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("ROI-Roll").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Analysis-MSI").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Reports-MSI").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("ROI-MSI").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Summary-MSI").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("paper calculator").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Labor").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Fluids").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Consumables").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Primer Calculator").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Lookups").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Currency Table").Select
        ActiveWindow.SelectedSheets.Visible = False
        Range("O16").Select
        Sheets("Read Prior to use").Select
        Sheets("Input").Visible = True
        Sheets("Input").Select
        Sheets("Analysis-MSI").Visible = True
        Sheets("Analysis-MSI").Select
        Sheets("Reports-MSI").Visible = True
        Sheets("Reports-MSI").Select
        Sheets("ROI-MSI").Visible = True
        Sheets("ROI-MSI").Select
        Sheets("Summary-MSI").Visible = True
        Sheets("Summary-MSI").Select
        Sheets("Primer Calculator").Visible = True
        Sheets("Primer Calculator").Select
        Sheets("Labor").Visible = True
        Sheets("Primer Calculator").Select
        Sheets("paper calculator").Visible = True
        Sheets("Labor").Select
        Sheets("Fluids").Visible = True
        Sheets("Primer Calculator").Select
        Sheets("Consumables").Visible = True
        Sheets("Primer Calculator").Select
        Sheets("Currency Table").Visible = True
        ActiveWindow.ScrollWorkbookTabs Sheets:=-1
        ActiveWindow.ScrollWorkbookTabs Sheets:=-1
        ActiveWindow.ScrollWorkbookTabs Sheets:=-1
        ActiveWindow.ScrollWorkbookTabs Sheets:=-1
        Sheets("Input").Select
        Sheets("Inputs explained").Visible = True
        Sheets("Input").Select
        Range("G7").Select
        End If
        
        
        If cc.Range("J24") Like "*Page*" Then
         Sheets("Read Prior to use").Select
        Sheets("simple ROI").Visible = True
        Sheets("simple ROI").Select
        Sheets("Inputs explained").Visible = True
        Sheets("Inputs explained").Select
        Sheets("Input").Visible = True
        Sheets("Input").Select
        Sheets("Analysis-Page").Visible = True
        Sheets("Analysis-Page").Select
        Sheets("Reports-Page").Visible = True
        Sheets("Reports-Page").Select
        Sheets("ROI-Page").Visible = True
        Sheets("ROI-Page").Select
        Sheets("Summary-Page").Visible = True
        Sheets("Summary-Page").Select
        Sheets("Analysis-Roll").Visible = True
        Sheets("Analysis-Roll").Select
        Sheets("Reports-Rolls").Visible = True
        Sheets("Reports-Rolls").Select
        Sheets("ROI-Roll").Visible = True
        Sheets("ROI-Roll").Select
        Sheets("Summary-Roll").Visible = True
        Sheets("Summary-Roll").Select
        Sheets("Analysis-MSI").Visible = True
        Sheets("Analysis-MSI").Select
        Sheets("Reports-MSI").Visible = True
        Sheets("Reports-MSI").Select
        Sheets("ROI-MSI").Visible = True
        Sheets("ROI-MSI").Select
        Sheets("Summary-MSI").Visible = True
        Sheets("Summary-MSI").Select
        Sheets("paper calculator").Visible = True
        Sheets("paper calculator").Select
        Sheets("Labor").Visible = True
        Sheets("Labor").Select
        Sheets("Fluids").Visible = True
        Sheets("Fluids").Select
        Sheets("Consumables").Visible = True
        Sheets("Consumables").Select
        Sheets("Primer Calculator").Visible = True
        Sheets("Primer Calculator").Select
        Sheets("Lookups").Visible = True
        Sheets("Lookups").Select
        Sheets("Currency Table").Visible = True
        Sheets("simple ROI").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Inputs explained").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Input").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Analysis-Page").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Reports-Page").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("ROI-Page").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Summary-Page").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Analysis-Roll").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Reports-Rolls").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Summary-Roll").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("ROI-Roll").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Analysis-MSI").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Reports-MSI").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("ROI-MSI").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Summary-MSI").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("paper calculator").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Labor").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Fluids").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Consumables").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Primer Calculator").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Lookups").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Currency Table").Select
        ActiveWindow.SelectedSheets.Visible = False
        Range("O16").Select
        Sheets("Read Prior to use").Select
        Sheets("Inputs explained").Visible = True
        Sheets("Inputs explained").Select
        Sheets("Input").Visible = True
        Sheets("Input").Select
        Sheets("Analysis-Page").Visible = True
        Sheets("Analysis-Page").Select
        Sheets("Reports-Page").Visible = True
        Sheets("Reports-Page").Select
        Sheets("ROI-Page").Visible = True
        Sheets("ROI-Page").Select
        Sheets("Summary-Page").Visible = True
        Sheets("Summary-Page").Select
        Sheets("paper calculator").Visible = True
        Sheets("paper calculator").Select
        Sheets("Labor").Visible = True
        Sheets("Labor").Select
        Sheets("Fluids").Visible = True
        Sheets("Fluids").Select
        Sheets("Consumables").Visible = True
        Sheets("Consumables").Select
        Sheets("Primer Calculator").Visible = True
        Sheets("Primer Calculator").Select
        Sheets("Currency Table").Visible = True
        ActiveWindow.ScrollWorkbookTabs Sheets:=-1
        ActiveWindow.ScrollWorkbookTabs Sheets:=-1
        ActiveWindow.ScrollWorkbookTabs Sheets:=-1
        ActiveWindow.ScrollWorkbookTabs Sheets:=-1
        ActiveWindow.ScrollWorkbookTabs Sheets:=-1
        ActiveWindow.ScrollWorkbookTabs Sheets:=-1
        Sheets("Input").Select
        Range("G7").Select
        End If
         If cc.Range("J24") Like "*Roll*" Then
          Sheets("Read Prior to use").Select
        Sheets("simple ROI").Visible = True
        Sheets("simple ROI").Select
        Sheets("Inputs explained").Visible = True
        Sheets("Inputs explained").Select
        Sheets("Input").Visible = True
        Sheets("Input").Select
        Sheets("Analysis-Page").Visible = True
        Sheets("Analysis-Page").Select
        Sheets("Reports-Page").Visible = True
        Sheets("Reports-Page").Select
        Sheets("ROI-Page").Visible = True
        Sheets("ROI-Page").Select
        Sheets("Summary-Page").Visible = True
        Sheets("Summary-Page").Select
        Sheets("Analysis-Roll").Visible = True
        Sheets("Analysis-Roll").Select
        Sheets("Reports-Rolls").Visible = True
        Sheets("Reports-Rolls").Select
        Sheets("ROI-Roll").Visible = True
        Sheets("ROI-Roll").Select
        Sheets("Summary-Roll").Visible = True
        Sheets("Summary-Roll").Select
        Sheets("Analysis-MSI").Visible = True
        Sheets("Analysis-MSI").Select
        Sheets("Reports-MSI").Visible = True
        Sheets("Reports-MSI").Select
        Sheets("ROI-MSI").Visible = True
        Sheets("ROI-MSI").Select
        Sheets("Summary-MSI").Visible = True
        Sheets("Summary-MSI").Select
        Sheets("paper calculator").Visible = True
        Sheets("paper calculator").Select
        Sheets("Labor").Visible = True
        Sheets("Labor").Select
        Sheets("Fluids").Visible = True
        Sheets("Fluids").Select
        Sheets("Consumables").Visible = True
        Sheets("Consumables").Select
        Sheets("Primer Calculator").Visible = True
        Sheets("Primer Calculator").Select
        Sheets("Lookups").Visible = True
        Sheets("Lookups").Select
        Sheets("Currency Table").Visible = True
         Sheets("simple ROI").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Inputs explained").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Input").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Analysis-Page").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Reports-Page").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("ROI-Page").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Summary-Page").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Analysis-Roll").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Reports-Rolls").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Summary-Roll").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("ROI-Roll").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Analysis-MSI").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Reports-MSI").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("ROI-MSI").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Summary-MSI").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("paper calculator").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Labor").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Fluids").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Consumables").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Primer Calculator").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Lookups").Select
        ActiveWindow.SelectedSheets.Visible = False
        Sheets("Currency Table").Select
        ActiveWindow.SelectedSheets.Visible = False
        Range("O16").Select
        Sheets("Read Prior to use").Select
        Sheets("Inputs explained").Visible = True
        Sheets("Inputs explained").Select
        Sheets("Input").Visible = True
        Sheets("Input").Select
        Sheets("Analysis-Roll").Visible = True
        Sheets("Analysis-Roll").Select
        Sheets("Reports-Rolls").Visible = True
        Sheets("Reports-Rolls").Select
        Sheets("ROI-Roll").Visible = True
        Sheets("ROI-Roll").Select
        Sheets("Summary-Roll").Visible = True
        Sheets("Summary-Roll").Select
        Sheets("paper calculator").Visible = True
        Sheets("paper calculator").Select
        Sheets("Labor").Visible = True
        Sheets("Labor").Select
        Sheets("Fluids").Visible = True
        Sheets("Fluids").Select
        Sheets("Consumables").Visible = True
        Sheets("Consumables").Select
        Sheets("Primer Calculator").Visible = True
        Sheets("Primer Calculator").Select
        Sheets("Currency Table").Visible = True
        ActiveWindow.ScrollWorkbookTabs Sheets:=-1
        ActiveWindow.ScrollWorkbookTabs Sheets:=-1
        ActiveWindow.ScrollWorkbookTabs Sheets:=-1
        ActiveWindow.ScrollWorkbookTabs Sheets:=-1
        ActiveWindow.ScrollWorkbookTabs Sheets:=-1
        Sheets("Input").Select
        Range("G7").Select
        End If
        Application.ScreenUpdating = True ' Turn-off screen updates
         
         End Sub

  3. #3
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Hidden pages pop up out of no where!!!

    Too much of a pain to read that lot - attach a sample workbook. No data is needed, the relevent data can be simply entered manually in J24 on sheet "Read Prior to use"

  4. #4
    Registered User
    Join Date
    11-06-2015
    Location
    San Diego
    MS-Off Ver
    2013
    Posts
    82

    Re: Hidden pages pop up out of no where!!!

    Hi Thank you for replying,
    I tried that before when I take the data out I no longer have the issue because formulas are not re calculating when I change a cell. Maybe I can explain the issue I am having better.
    So basically I have a macro to hide or unhide pages right. Once I run this macro when ever I change any cell on any page (keep in mind all cells are somehow connected to cells on other pages through formulas and lookups). When I change any cell random pages that are hidden just seem to pop up on the worksheet like multiple pages at once in a huge mess and I have to go to another page to make it go away. Has anyone ever had a similar problem?
    Thank you,
    Your friend

  5. #5
    Registered User
    Join Date
    11-06-2015
    Location
    San Diego
    MS-Off Ver
    2013
    Posts
    82

    Re: Hidden pages pop up out of no where!!!

    Hi Thank you for replying,
    I tried that before when I take the data out I no longer have the issue because formulas are not re calculating when I change a cell. Maybe I can explain the issue I am having better.
    So basically I have a macro to hide or unhide pages right. Once I run this macro when ever I change any cell on any page (keep in mind all cells are somehow connected to cells on other pages through formulas and lookups). When I change any cell random pages that are hidden just seem to pop up on the worksheet like multiple pages at once in a huge mess and I have to go to another page to make it go away. Has anyone ever had a similar problem?
    Thank you,
    Your friend

  6. #6
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Hidden pages pop up out of no where!!!

    I doubt anyone can help with that without seeing the workbook, formulas and all...

  7. #7
    Registered User
    Join Date
    11-06-2015
    Location
    San Diego
    MS-Off Ver
    2013
    Posts
    82

    Re: Hidden pages pop up out of no where!!!

    hi,
    No one has ever encountered anything like this? Where after running a macro changing any cell in a workbook causes random things to pop up on your screen like random tables from other worksheets on the workbook all mixed together in a mess.
    Thank you,
    your friend?

  8. #8
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Hidden pages pop up out of no where!!!

    I'm sure someone may be able to help you, I doubt I have the expertise necessary.

  9. #9
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,692

    Re: Hidden pages pop up out of no where!!!

    I sure hope that you don't expect people to go through close to 400 lines of messy code.
    A quick look, and I might be wrong here, shows that in the first +/- 100 lines all you do is open and hide sheets. Do a Google search like "Is selecting needed in Excel?"
    After all, you haven't taken any time to clean it up. You have 50 posts so you must have seen how things are done or are expected to be done.

  10. #10
    Registered User
    Join Date
    11-06-2015
    Location
    San Diego
    MS-Off Ver
    2013
    Posts
    82

    Re: Hidden pages pop up out of no where!!!

    Hi,
    Thank you fort he reply. The first hundred lines of opening all the sheets is crucial because I dont know which sheets a user has open prior to running the macro. Simply all the macro does is open all pages then close all pages except for the ones that satisfy the configuration the user chooses. I am unable to share a work book because of sensitive information in my model. I can not take the sensitive info out because it the issue will not occur otherwise. If there is any more info I can provide to help with this please let me know than you so much.

  11. #11
    Valued Forum Contributor
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Office 365 ProPlus
    Posts
    853

    Re: Hidden pages pop up out of no where!!!

    Can you post up the Workbook with sample data of some sort.

    the issue could be one of anything. It sounds like you have some sort of onchange event firing off.

    You can also probably simplify some code by looping all the sheets as well to hide or unhide what you need vs selecting each one individually.

  12. #12
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,077

    Re: Hidden pages pop up out of no where!!!

    The first hundred lines of opening all the sheets is crucial because I dont know which sheets a user has open prior to running the macro
    No, it isn't. You could have a three line loop that makes all the sheets visible. And then, when you have two lines to select, then hide or unhide the sheet, it can be combined into one line removing the select ... ActiveWindow.SelectedSheets bit. Halves that code. And no scrolling is necessary.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  13. #13
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,347

    Re: Hidden pages pop up out of no where!!!

    Also worth noting those 3 if statements are almost identical and I think the last two are identical (so you could at least merge them together) "If A or B then"
    Last edited by scottiex; 04-25-2016 at 08:38 PM.

  14. #14
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Hidden pages pop up out of no where!!!

    Ignore - Issues with the firewall. I had < & > in the text with a word between and it complained about HTML code.
    Last edited by cytop; 04-26-2016 at 02:40 AM.

  15. #15
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Hidden pages pop up out of no where!!!

    Even more worth noting is something like this
    If cc.Range("J24") Like "*MSI*" Then
        .
        Sheets("Input").Visible = True
        .
        Sheets("Input").Select
        ActiveWindow.SelectedSheets.Visible = False
        .
        Sheets("Input").Visible = True
    Those 3 statements appear in the same IF block.

    There are 369 source lines in the code you posted. It is probably the most inefficient procedure I've seen posted on a forum. That's not your fault it's just the way the macro recorder works - but you didn't even think about the steps you were taking while recording it and so have ended up with redundant statements like that (There are probably more of then, I really don't feel like wasting time looking).

    The first hundred lines of opening all the sheets is crucial
    Of course, but 100 lines? As TMS said that can be condensed into 3 lines, and the whole procedure was condensed into 15 and I thought that a little verbose. However, I'm not going to post it because it is nothing to do with your problem - the root cause is elsewhere.

    No one has ever encountered anything like this?
    Of course we have, it's part and parcel of an event driven environment - and, ignoring my comment about 'expertise' above (That was a lie), we're experts at finding problems like that as they pop up most days, if not 2 or 3 times a day.

    I have like a 15 sheet workbook
    Really? Go back and count them, or just go to the Immediate Window in the VBA environment and type
    ?Sheets.Count [enter]
    If you can't even get that right...?

    You don't want to post your workbook "because of sensitive information" - No one is remotely interested in your data but it will take time for you to anonymise a sample, which is probably the real reason you're so reluctant.

    All in all, I'd probably suggest you abandon this thread (Ask a Mod to close it so no one else wastes time on it). It can be difficult at times to diagnose a problem, but it's a bit much to ask someone to recreate a workbook that displays your issue first.

    Go back and record a sensible macro planning your steps in advance, start a new thread and post a copy of your workbook with a sample of anonymised data - you're not going to get an answer otherwise.
    Last edited by cytop; 04-26-2016 at 02:35 AM.

  16. #16
    Registered User
    Join Date
    11-06-2015
    Location
    San Diego
    MS-Off Ver
    2013
    Posts
    82

    Re: Hidden pages pop up out of no where!!!

    Hello Cytop,
    Thank you for the reply. I understand your position on this and apologize if you feel your time was wasted. I am sure it is evident I did not intend to bother anyone nor ask redundant questions. I appreciate all the helpful advice above and will try remember your comments while posting a thread in the future. I am an intern analyst for a fortune 50 company in southern California and as you can probably see my VBA skills are quite limited. However I feel I am making progress due to the help of this forum. I will re-make the macro this afternoon with everyone's comments in mind if I am successful in correcting the problem I will post the solution here if I am not I will end this thread as to not waste anymore time.
    Thank you everyone who contributed so much,
    Your Friend

  17. #17
    Registered User
    Join Date
    11-06-2015
    Location
    San Diego
    MS-Off Ver
    2013
    Posts
    82

    Re: Hidden pages pop up out of no where!!!

    Hey guys,
    I took out
    For Each WS In ThisWorkbook.Worksheets
        If WS.Name <> ActiveSheet.Name Then WS.Visible = xlSheetHidden
    Next WS
    because I had it in there twice for no reason and it works fine now. I hope it lasts.
    Thank you guys,
    Your friend

  18. #18
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Hidden pages pop up out of no where!!!

    see below......
    Last edited by cytop; 04-26-2016 at 02:28 AM.

  19. #19
    Registered User
    Join Date
    11-06-2015
    Location
    San Diego
    MS-Off Ver
    2013
    Posts
    82

    Re: Hidden pages pop up out of no where!!!

    Hey guys so I wrote new macro for this procedure and the macro works however I still have the same issue. I will post the code below I am beginning to think it has nothing to do with the macro maybe its something else entirely however it only occurs after I run the macro. I am not sure basically after I run the macro when I change any input cell in the model random pages just seem to appear on top of each other in a big mess. Any other ideas on a solution?
    Thank you everyone,
    Your friend.



    Sub unhideforanalysis()
    '
    
    Dim cc As Worksheet: Set cc = Sheets("Read Prior to use")
    Dim rng As Range, c As Range
    Dim p As Range
    Dim WS As Worksheet
    Application.ScreenUpdating = False ' Turn-off screen updates
           If cc.Range("J24") Like "*MSI*" Then
    For Each WS In ThisWorkbook.Worksheets
        If WS.Name <> ActiveSheet.Name Then WS.Visible = xlSheetVisible
    Next WS
    For Each WS In ThisWorkbook.Worksheets
        If WS.Name <> ActiveSheet.Name Then WS.Visible = xlSheetHidden
    Next WS
    Sheets("Input").Visible = True
        Sheets("Analysis-MSI").Visible = True
        Sheets("Reports-MSI").Visible = True
        Sheets("ROI-MSI").Visible = True
        Sheets("Summary-MSI").Visible = True
        Sheets("Primer Calculator").Visible = True
        Sheets("Labor").Visible = True
        Sheets("paper calculator").Visible = True
        Sheets("Fluids").Visible = True
        Sheets("Consumables").Visible = True
      Sheets("Currency Table").Visible = True
        Sheets("Inputs explained").Visible = True
        Sheets("Input").Select
        Range("G7").Select
        End If
        If cc.Range("J24") Like "*Page*" Then
          For Each WS In ThisWorkbook.Worksheets
        If WS.Name <> ActiveSheet.Name Then WS.Visible = xlSheetVisible
    Next WS
    For Each WS In ThisWorkbook.Worksheets
        If WS.Name <> ActiveSheet.Name Then WS.Visible = xlSheetHidden
    Next WS
          Sheets("Input").Visible = True
        Sheets("Input").Select
        Sheets("Analysis-Page").Visible = True
        Sheets("Analysis-Page").Select
        Sheets("Reports-Page").Visible = True
        Sheets("Reports-Page").Select
        Sheets("ROI-Page").Visible = True
        Sheets("ROI-Page").Select
        Sheets("Summary-Page").Visible = True
        Sheets("Summary-Page").Select
        Sheets("paper calculator").Visible = True
        Sheets("paper calculator").Select
        Sheets("Labor").Visible = True
        Sheets("Labor").Select
        Sheets("Fluids").Visible = True
        Sheets("Fluids").Select
        Sheets("Consumables").Visible = True
        Sheets("Consumables").Select
        Sheets("Primer Calculator").Visible = True
        Sheets("Primer Calculator").Select
        Sheets("Currency Table").Visible = True
      Sheets("Input").Select
        Range("G7").Select
        End If
         If cc.Range("J24") Like "*Roll*" Then
           For Each WS In ThisWorkbook.Worksheets
        If WS.Name <> ActiveSheet.Name Then WS.Visible = xlSheetVisible
    Next WS
    For Each WS In ThisWorkbook.Worksheets
        If WS.Name <> ActiveSheet.Name Then WS.Visible = xlSheetHidden
    Next WS
          Sheets("Input").Visible = True
        Sheets("Input").Select
        Sheets("Analysis-Roll").Visible = True
        Sheets("Analysis-Roll").Select
        Sheets("Reports-Rolls").Visible = True
        Sheets("Reports-Rolls").Select
        Sheets("ROI-Roll").Visible = True
        Sheets("ROI-Roll").Select
        Sheets("Summary-Roll").Visible = True
        Sheets("Summary-Roll").Select
        Sheets("paper calculator").Visible = True
        Sheets("paper calculator").Select
        Sheets("Labor").Visible = True
        Sheets("Labor").Select
        Sheets("Fluids").Visible = True
        Sheets("Fluids").Select
        Sheets("Consumables").Visible = True
        Sheets("Consumables").Select
        Sheets("Primer Calculator").Visible = True
        Sheets("Primer Calculator").Select
        Sheets("Currency Table").Visible = True
         Sheets("Input").Select
        Range("G7").Select
        End If
    
        Sheets("Input").Select
        Sheets("Read Prior to use").Visible = True
        Sheets("Input").Select
        Range("B15").Select
        Application.ScreenUpdating = True ' Turn-off screen updates
         
         End Sub

  20. #20
    Valued Forum Contributor
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Office 365 ProPlus
    Posts
    853
    Again. If you provide a sample, someone here can help you learn better and simplify your code. You have a lot of selects and other that could be made easier.

  21. #21
    Registered User
    Join Date
    11-06-2015
    Location
    San Diego
    MS-Off Ver
    2013
    Posts
    82

    Re: Hidden pages pop up out of no where!!!

    Hello,
    I am marking this thread solved. Thank you guys so much. Sorry about not posting a workbook I get very scared sometimes about the models I am given to work on (i feel like if someone sees I posted it I will get fired) and if I take all the useful information out of them it becomes hard to really understand what I am trying to do I will find a solution to this going froward. Again thank you all so much for helping me in this matter.
    Your Friend,
    Marvin Abou

+ 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] Need to Print Hidden Pages with value in a range
    By groundin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-15-2013, 05:25 PM
  2. Replies: 1
    Last Post: 12-05-2012, 05:30 AM
  3. Hidden rows are printing as blank pages...
    By tprice317 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-19-2012, 03:01 AM
  4. Hidden Pages to Appear on Hyperlink
    By grounded in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-06-2009, 10:03 AM
  5. How do I print hidden pages?
    By Bafa in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-14-2008, 03:12 PM
  6. Pages hidden with manual breaks still print
    By D Poole in forum Excel General
    Replies: 1
    Last Post: 02-10-2006, 10:50 AM

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