+ Reply to Thread
Results 1 to 4 of 4

Hide on mass - Macro

  1. #1
    Registered User
    Join Date
    11-20-2008
    Location
    UK
    Posts
    36

    Hide on mass - Macro

    Hey,

    I have a workbook that calculates total capacity based on how many people are listed as "present"

    I wish to make a printout. So I have the idea of Copy/Pasting the spreadsheet again, and setting all columns/rows I dont need to hide.

    Please Login or Register  to view this content.
    That hides the selected cells column if the cell = Capacity (IE needless info for report)

    Is there a way to have this work the same way if I was to select an entire row? (Title Row)

    Ill keep trying at the same time.

    Thanks in advance!

  2. #2
    Registered User
    Join Date
    10-25-2006
    Posts
    54

    Re: Hide on mass - Macro

    Hi

    Even if you were to select the entirerow you would still have to specify which cell was the activecell so that wouldn't really give you the deisred result.

    How about the following. Could you change the "to" value of i to the number of columns that you want to check less 1 (ie if there were 11 columns to check the i=1 to 10). The IF statement uses an else so that you will always move over one column to the right whether the selected column is hidden or not. The FOR...NEXT loop sits outside the IF statement so that you're running the IF statement for each number in the loop.

    Please Login or Register  to view this content.

    I'm not sure that you'll be looking for the word "Capacity" in each column. If that's the case then you may want to use an array. For example say you wanted to hide the columns that were headed "Capacity","Date" and "Gender";

    Please Login or Register  to view this content.

    Hope that maybe of some use.

    A
    Last edited by AndySuk; 03-16-2009 at 09:50 AM.

  3. #3
    Registered User
    Join Date
    11-20-2008
    Location
    UK
    Posts
    36

    Re: Hide on mass - Macro

    The first code worked like a charm! Thanks alot!

    The second didnt do anything(With my titles ofc) so I tried the following

    Please Login or Register  to view this content.
    EDIT : No Luck
    Last edited by Irprogram; 03-16-2009 at 10:48 AM.

  4. #4
    Registered User
    Join Date
    11-20-2008
    Location
    UK
    Posts
    36

    Re: Hide on mass - Macro

    GOT IT!

    In used the first macro, 3 times then set them to functions.

    Thanks so much :D

+ 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