Results 1 to 10 of 10

Thread: Hide headings in all worksheets
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Aug 2019
    Posts
    49
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Hide headings in all worksheets

    No doubt this has been covered before

    is there a VBA to hide the headings in all worksheets

    Thanks everyone

    Regards

    Jason Bing

  2. #2
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    29,177
    Post Thanks / Like
    Mentioned
    483 Post(s)
    Tagged
    49 Thread(s)

    Default Re: Hide headings in all worksheets

    How about
    Code:
    Sub JasonBing()
       Sheets.Select
       ActiveWindow.DisplayHeadings = False
    End Sub
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  3. #3
    New Member
    Join Date
    Aug 2019
    Posts
    49
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Hide headings in all worksheets

    This works great in the test book, thank you

    However the sheets are all protected in the master database

    What do I have to add to the code to unprotect the sheets then protect after

    Thanks

    Jason Bing

  4. #4
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    29,177
    Post Thanks / Like
    Mentioned
    483 Post(s)
    Tagged
    49 Thread(s)

    Default Re: Hide headings in all worksheets

    There shouldn't be any need to unprotect the sheets
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  5. #5
    New Member
    Join Date
    Aug 2019
    Posts
    49
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Hide headings in all worksheets

    Thanks for the reply. I am getting a Run-Time error 1004

    Unprotected method of worksheet class failed. this is in another unrelated macro in a different module. It is appearing in the


    Code:
    ActiveSheet.unprotect ""

    I have disabled all parts of the sub and it is the sheets.select that is causing the error

    If I manually select all the sheet tabs and hide headings. it works fine



    Thanks for the help

    Jason Bing

  6. #6
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    29,177
    Post Thanks / Like
    Mentioned
    483 Post(s)
    Tagged
    49 Thread(s)

    Default Re: Hide headings in all worksheets

    You don't need to unprotect sheets in order to hide the headings, so just get rid of that line.
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  7. #7
    New Member
    Join Date
    Aug 2019
    Posts
    49
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Hide headings in all worksheets

    I don’t have this line in that macro. I appears to be all the other macros with this line in it. Something about some of the other macros with

    Activesheets.unprotect “” in them.

    I can select all the sheets manually just fine, but when I do it via vba, even sheets.select in its own macro, I get the error, in random codes containing

    Activesheets.unprotect “”
    Or
    Activesheets.protect “”

    This function is not critical just handy but if you have Any ideas I’m keen to learn. Is this a topic for a new thread?

    Regards

    Jason Bing

  8. #8
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    29,177
    Post Thanks / Like
    Mentioned
    483 Post(s)
    Tagged
    49 Thread(s)

    Default Re: Hide headings in all worksheets

    Does the code I suggested do what you need?
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  9. #9
    New Member
    Join Date
    Aug 2019
    Posts
    49
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Hide headings in all worksheets

    Completely. Yes

    Thank you

    Jason

  10. #10
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    29,177
    Post Thanks / Like
    Mentioned
    483 Post(s)
    Tagged
    49 Thread(s)

    Default Re: Hide headings in all worksheets

    You're welcome & thanks for the feedback
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •