+ Reply to Thread
Results 1 to 6 of 6

Unhide columns based on the previous column's value

  1. #1
    Registered User
    Join Date
    08-27-2012
    Location
    pretoria
    MS-Off Ver
    Excel 2010
    Posts
    3

    Unhide columns based on the previous column's value

    Hi guys

    i am new to this and am really struggling. i cant seem to find help for my specific problem on any site.

    i have a sheet with various comments columns, labelled comment 1 to comment 20. they are in colummn S to AL. we only want a column to show if the previous column has data in it. ie comment 2 will only be available if someone writes under comment 1.

    the length of the rows is about 1 000

    ant suggestions?
    Attached Files Attached Files
    Last edited by dumbom; 09-03-2012 at 06:00 AM.

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

    Re: Unhide columns based on the previous column's value

    Do you have a sample file that you can upload?

    To Attach a File:

    1. Click on Go Advanced
    2. In the frame Attach Files you will see the button Manage Attachments
    3. Click the button.
    4. A new window will open titled Manage Attachments - Excel Forum.
    5. Click the Browse... button to locate your file for uploading.
    6. This will open a new window File Upload.
    7. Once you have located the file to upload click the Open button. This window will close.
    8. You are now back in the Manage Attachments - Excel Forum window.
    9. Click the Upload button and wait until the file has uploaded.
    10. Close the window and then click Submit.
    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]

  3. #3
    Registered User
    Join Date
    08-27-2012
    Location
    pretoria
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Unhide columns based on the previous column's value

    i have attached a sample. essentially, all the comments columns except comment 1(column B) will be hidden, and once someone writes anything in that column, Comment 2(column C) will become visible, and so forth.

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

    Re: Unhide columns based on the previous column's value

    One question - even if there is 1 comment in the entire column T for example, you want column U to be unhidden?

  5. #5
    Registered User
    Join Date
    08-27-2012
    Location
    pretoria
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Unhide columns based on the previous column's value

    yeh, essentially that is the idea. I have come up with the below code. it works fine, and i have just repeated it for each column. i'm sure there is an easier way then repeating it, but this works for now for the code. i'm not sure if any of yuo are fimiliar with TM1, but when i save the document on TM1, it wont load anymore. it wont accept the excel format, so that defeated the purpose of my idea.

    Please Login or Register  to view this content.
    thanks for your help guys,
    cheers
    Last edited by arlu1201; 09-07-2012 at 08:20 AM.

  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: Unhide columns based on the previous column's value

    Welcome to the forum.

    I have added code tags to your post. As per forum rule 3, you need to use them whenever you put any code in your post. Please add them in future. If you need more information on how to use them, check my signature.

    Be right back with a solution.

+ 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