+ Reply to Thread
Results 1 to 36 of 36

Losing Sheet Tabs when suppressing Headings

  1. #1
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,952

    Losing Sheet Tabs when suppressing Headings

    The goal is to display my screen full size, showing only the active data and the sheet tabs, plus the vertical scrollbar. My macro to accomplish this is below. The macro is called by the workbook opening.

    The problem is, whether I leave the line ".DisplayWorkbookTabs = True" in the macro, or delete it out, the macro removes the workbook tabs, and leaves the column and row headers visible, when I want just the opposite. I've gone over the code and looked online, and can't find why it's happening. I've posted my example workbook. Any help is greatly appreciated.

    Thanks,
    John

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

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Losing Sheet Tabs when suppressing Headings

    Hello John,

    These 2 macros should help. These will hide and display the Taskbar. Currently, the Taskbar is hiding the sheet tabs. Copy this code into a separate VBA module. You can then add calls in your code where needed to control the Taskbar.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,952

    Re: Losing Sheet Tabs when suppressing Headings

    Thanks Leith, but I think you shot over my head with this one.

    I'm not sure how to use the Private Declare Functions, or are those used by the other two functions? For the other two, do I just construct a macro like the one below?
    Please Login or Register  to view this content.
    Sorry. What I know I know, and what I don't, I definitely don't.

  4. #4
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,952

    Re: Losing Sheet Tabs when suppressing Headings

    Okay, I answered my own question. I got it run by doing this:
    Please Login or Register  to view this content.
    However, my column and row headings are still showing (the 1,2,3 and A, B, C), and so is my horizontal toolbar. I thought the two "Display - False" statements above would remove those, but no. Any advice on that one?

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Losing Sheet Tabs when suppressing Headings

    Hello John,

    The headings belong to the Window class. Try this...
    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,952

    Re: Losing Sheet Tabs when suppressing Headings

    Leith,

    Your code almost does it. I have it set to trigger on the "Workbook Open" event, and so on the first screen the column and row headings are indeed gone. However, when I switch to the other tabs they come back. Should I put just the line
    Please Login or Register  to view this content.
    in the "Open" events of each worksheet?

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Losing Sheet Tabs when suppressing Headings

    Hello John,

    Add this to the Workbook_Open event. This will remove the headings from all the sheets.
    Please Login or Register  to view this content.

  8. #8
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,952

    Re: Losing Sheet Tabs when suppressing Headings

    Leith,

    I haven't tried your code yet, but had a question. I assume this one macro will do a one-time "DisplayHeadings=False" for all the sheets. Is the line
    Please Login or Register  to view this content.
    just to determine which sheet the user sees when opening the workbook?

  9. #9
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Losing Sheet Tabs when suppressing Headings

    Hello John,

    You're correct. The last line chooses which sheet you want to be active. The following line selects all the sheets in the workbook simultaneously.
    Please Login or Register  to view this content.

  10. #10
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,952

    Re: Losing Sheet Tabs when suppressing Headings

    That's what I thought. I'm getting to the point now that I can understand a lot of the code, but I still get confused. One routine you've used I've seen used elsewhere, and that's the "ReDim" statement. Can you explain exactly what that's doing in the macro?

  11. #11
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Losing Sheet Tabs when suppressing Headings

    Hello John,

    The ReDim statement is used to change the size of the last dimension of an array. If you want to resize an array that already contains data, you should use the statements ReDim Preserve <array>. If you do not then the array will be cleared.

    In this case, a single dimension array needs to be created that holds the names of all the sheets in the workbook. An array must be used to select more than one sheet at a time.

    The Sheets collection has a count of all the workbook sheets. However, the count can not be used directly when declaring the array. Using a Variant, an array can be created without using the Dim statement. ReDim will create and attach the new array to the variant.

  12. #12
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,952

    Re: Losing Sheet Tabs when suppressing Headings

    Okay, I think I'm following. But then why do you subtract 1 from the count?

  13. #13
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Losing Sheet Tabs when suppressing Headings

    Hello John,

    Unless you explicitly state the beginning element of the array, the first element defaults to zero. Some functions require zero based arrays and some are 1-based (starting at one). Here is an example of declaring a ten element array as 1-based.
    Please Login or Register  to view this content.

    Here is another way to do it using the Option Base statement. This is will define the first element of all arrays declared inside the module to begin with the number specified. This must be added to the top of the module's code.
    Please Login or Register  to view this content.

  14. #14
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,952

    Re: Losing Sheet Tabs when suppressing Headings

    Leith,

    I understand. You are a wise and noble teacher. Thank you for showering blessings of knowledge on this lowly neophyte. I will be forever in your debt.

    Thank you,
    John

  15. #15
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,952

    Re: Losing Sheet Tabs when suppressing Headings

    Leith,

    I've now tried your code, adding it to my other routine, so the completed macro (which has a problem) looks like this:
    Please Login or Register  to view this content.
    The macro is triggered by the workbook open event. The problem is that now I have a thin (maybe 1/4 inch) pale blue line at the top of the screen, which is covering the first line on my worksheets. Advice?

  16. #16
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Losing Sheet Tabs when suppressing Headings

    Hello John,

    I made 2 changes to the code and ran it. It runs fine on my machine. I removed the "ActiveSheet.DisplayHeadings = False" from the With statement and changed which sheet become the ActiveSheet.
    Please Login or Register  to view this content.

  17. #17
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,952

    Re: Losing Sheet Tabs when suppressing Headings

    Leith,

    No go. I copied exactly as you posted, changed the starting sheet back to Chart-View 1. That view presents just fine, but when I go to the other tabs the row and column headings reappear.

    Also, I've noticed that if I click on the chart located in each tab, the worksheet menu bar comes back into view, and stays in view until I click beyond the chart and onto the worksheet.

    Please Login or Register  to view this content.

  18. #18
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Losing Sheet Tabs when suppressing Headings

    Hello John,

    This macro will force the headings to be hidden whenever the sheet is activated. Add this to the ThisWorkbook module.
    Please Login or Register  to view this content.

    Change the code in your macro to what is below. This probably won't fix the Chart Sheet problem, but should fix the other.
    Please Login or Register  to view this content.

  19. #19
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,952

    Re: Losing Sheet Tabs when suppressing Headings

    Okay, now we're getting a "run-time error 1004: Select Method of Sheets Class failed", on this line:
    Please Login or Register  to view this content.

  20. #20
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Losing Sheet Tabs when suppressing Headings

    Hello John,

    This should fixz the problem.
    Please Login or Register  to view this content.

  21. #21
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,952

    Re: Losing Sheet Tabs when suppressing Headings

    Nope. Same error code, same line highlighted.

  22. #22
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Losing Sheet Tabs when suppressing Headings

    Hello John,

    I am out of ideas. Can you post the workbook? I can then test it out on my machine.

  23. #23
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,952

    Re: Losing Sheet Tabs when suppressing Headings

    Okay, here it is. I'm about to leave work for the day, so if you find anything I won't be able to check it until tomorrow morning. Thanks a lot for sticking with me through this.
    Attached Files Attached Files
    Last edited by jomili; 01-20-2011 at 06:34 PM.

  24. #24
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Losing Sheet Tabs when suppressing Headings

    Hello John,

    Thanks for posting the workbook. It would have taken forever to figure it out. You had hidden sheets and some with protection. This is what was causing the problem with the macro. I rewrote it and tested it. Everything looks good on my end. There were minor changes made elsewhere. Try out the attached workbook and let me know the results.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  25. #25
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,952

    Re: Losing Sheet Tabs when suppressing Headings

    Leith,

    Much better, but still with an issue. Opening the example I went to "View all Positions", then returned to the worksheet. The blue bar shown in the attached picture was obscuring the top row.

    As an FYI, all sheets (except Temp) should be protected (no password) at all times. On all the entrances and exits from the sheets I have protect/unprotect statements.

    Thanks for all your help on this. Any other ideas would be welcomed.
    Attached Images Attached Images

  26. #26
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,952

    Re: Losing Sheet Tabs when suppressing Headings

    Follow-up: I tried the last macro you posted in my full sheet, hit the same error on the same line.

    As a workaround, I've gone back to the original macro you posted, and put
    Please Login or Register  to view this content.
    in every worksheet activate event. It's all working, except I still have that one solid light blue line (looks like the Command Bar minus all the selections ("File", "Edit", etc.). The blue line doesn't show up in the initial view, but when navigating via any of the macros it appears.
    Last edited by jomili; 01-21-2011 at 11:19 AM.

  27. #27
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Losing Sheet Tabs when suppressing Headings

    Hello John,

    The blue line is indeed where the menu bar would be. For some reason, your system is failing to render the application window correctly. My first suspicion is lack of memory.

    Check your memory while the workbook is open. In Windows 2003 you can monitor your memory using the Windows Task Manager. To bring it up, use CTRL+ALT+Del and then select the performance tab.

  28. #28
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,952

    Re: Losing Sheet Tabs when suppressing Headings

    Leith,

    Running the application, Excel.exe is using 31,024K of memorey. The biggest memory hog on the PC is the "fssm32.exe" which is part of our Antivirus solution. That one uses 149,124K. I don't know where to see what percentage of memory is being consumed, but the Performance tab shows we're sailing right along.

  29. #29
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Losing Sheet Tabs when suppressing Headings

    Hello John,

    Check if you are approaching your limit with physical memory. The sum of available memory and the cache memory should be well below the total shown on the Performance tab.

  30. #30
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,952

    Re: Losing Sheet Tabs when suppressing Headings

    Total physical memory is 3405388
    Available is 2543952
    System Cache is 1729808

  31. #31
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Losing Sheet Tabs when suppressing Headings

    Hello John,

    Well, it looks like you have plenty of memory. If you can, try running the program with the anti-virus turned off and see if that changes anything.

  32. #32
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,952

    Re: Losing Sheet Tabs when suppressing Headings

    Can't do that here; they don't give us that much control over our PCs.

  33. #33
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Losing Sheet Tabs when suppressing Headings

    Hello John,

    Can you run the file on another machine with the same anti-virus software? If you get the same result, it is probably due to the anti-virus hogging the resources.

  34. #34
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,952

    Re: Losing Sheet Tabs when suppressing Headings

    Yep, got the same result on another user's PC. So, is there no hope?

  35. #35
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Losing Sheet Tabs when suppressing Headings

    Hello John,

    Just to be sure it is work related, run the workbook on your computer at home. If it is work related then I don't know where to go next.

  36. #36
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,952

    Re: Losing Sheet Tabs when suppressing Headings

    Only problem there is that I have Excel 2007 at home, 2003 at work, and I'm running on Vista at home, and XP at work. So it wouldn't be a fair test. I guess I'll just adjust everything downward by a quarter inch and see how that goes.

    Thanks for all your help on this,
    John

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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