+ Reply to Thread
Results 1 to 5 of 5

VBA code to hide defined names in worksheet

  1. #1
    Registered User
    Join Date
    10-23-2007
    Posts
    80

    VBA code to hide defined names in worksheet

    Hello everyone,

    I'm not sure how tricky this one might be, but here's what I'm trying to do:

    On one worksheet, I have ten defined names. Each name is basically a collection of rows (the whole row). So, for example, rows 9 to 18 have the name GoTo01, and rows 19 to 32 have the name GoTo02 (the number of rows varies in each name). What I want is a macro that will hide each name (so hide the rows) providing the total value is zero. So basically, I want it to select GoTo01 and if the sum of that is zero I want it to hide it and then move on to do the same thing for GoTo02... etc etc.

    Does that make sense? I know I haven't explained myself very well.

    Thanks again everyone!
    Last edited by lealea1982; 11-05-2010 at 06:01 AM.

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: VBA Loops

    If you have no other named ranges, perhaps this will work?
    Please Login or Register  to view this content.
    EDIT: please follow the forum rules and change your thread title to something more descriptive.

  3. #3
    Registered User
    Join Date
    10-23-2007
    Posts
    80

    Re: VBA code to hide defined names in worksheet

    That works brilliantly thank you, but unfortunately I do have a few other named ranges throughout the workbook. Is it possible to apply this macro to the active sheet only?

  4. #4
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: VBA code to hide defined names in worksheet

    If the others don't start with Goto, this should work.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-23-2007
    Posts
    80

    Re: VBA code to hide defined names in worksheet

    Fantastic, thank you so much, it works brilliantly!!

+ 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