+ Reply to Thread
Results 1 to 6 of 6

Hiding the same column on multiple sheets

  1. #1
    Registered User
    Join Date
    06-13-2008
    Posts
    8

    Hiding the same column on multiple sheets

    Hi,

    I have a macro that performs the same actions to an array of sheets. I need to be able to hide a column on all of the tabs, but if I hide the column on the activated sheet while the array of sheets is selected, it only hides that column on the activated sheet. Is there a way to hide that column on all of the sheets?

    What may complicate the issue is that the array of sheets that are selected is dynamic and will change as more sheets are added. Also, the column that will be hidden will change. The hidden column is specified by a value in cell b11 of each sheet that has the column number that needs to be hidden. I really appreciate your help, you guys (and or girls) really amaze me sometimes. Thanks!

  2. #2
    Valued Forum Contributor Shijesh Kumar's Avatar
    Join Date
    05-26-2008
    Location
    Bangalore / India
    MS-Off Ver
    2000
    Posts
    717
    Here is a sample code for you

    It hides the column specified in cell "B11" of all the sheets in the work books.
    You can ammend it to hide the columns of the sheet you want to hide..
    In B11 enter the column you want to hide eg... D , E , F or so on


    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    06-13-2008
    Posts
    8
    Quote Originally Posted by Shijesh Kumar
    Here is a sample code for you

    It hides the column specified in cell "B11" of all the sheets in the work books.
    You can ammend it to hide the columns of the sheet you want to hide..
    In B11 enter the column you want to hide eg... D , E , F or so on


    Please Login or Register  to view this content.

    OK, this is going to work, and really well, but I have the column number in cell B11, I can probably adjust it to return the letter code, but it will be alot easier and better on memory if I can just use the column number instead. Is it possible? Also, do I have to adjust the portion where it says "sheet1" to be one of my sheets before I run the macro? Thank you SO much!

  4. #4
    Registered User
    Join Date
    06-13-2008
    Posts
    8
    WAIT! Nevermind, I figured it out. Thank you so much for your help, I cant express how much this helps me!

  5. #5
    Registered User
    Join Date
    01-25-2013
    Location
    Miami, FL
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Hiding the same column on multiple sheets

    I was wondering what if your workbook has 5 sheets and you only want to apply this macro to only 4 of them?
    Thanks

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Hiding the same column on multiple sheets

    grimm,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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