+ Reply to Thread
Results 1 to 13 of 13

Make columns visible/invisible as per the conditions

  1. #1
    Registered User
    Join Date
    09-04-2009
    Location
    India
    MS-Off Ver
    Excel 2002
    Posts
    10

    Make columns visible/invisible as per the conditions

    Hello All,

    I have a requirement. I am trying to create a daily task activity sheet. I would like to know, how to make the columns visible and invisible as per the selection from previous column.

    For eg:

    Column A has a list which has values 'TC creation' , 'TC modification', 'System Test' etc.

    Upon selecting TC creation, i need to make a column visible ie 'total tcs created'.

    Upon selecting 'TC modification' i would have to make the previous column invisible and make a new column visible for entering no of tcs modified.

    Upon selecting 'System test' the other columns should go invisible and make other 3 columns visible for no of tcs executed, no of tcs passed, no of tcs failed etc...

    Please help me in getting the solution.Awaiting for the earliest reply.

    Thanks in advance,
    Deeps

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Make columns visible/invisible as per the conditions

    Can you please post a sample workbook so we can see the columns / ranges in question... remove names etc - all that's required is a cell in which the validation list is present and to understand which columns are to be hidden/unhidden in relation to each choice.

  3. #3
    Registered User
    Join Date
    09-04-2009
    Location
    India
    MS-Off Ver
    Excel 2002
    Posts
    10

    Re: Make columns visible/invisible as per the conditions

    I have uploaded a sample spreadsheet.

    When I select 'Test case Creation, I should be able to see only column 'E' and 'Q'.
    When I select 'Test case Modification,I should be able to see only column 'F' and 'Q'.
    When I select 'Test Scenario creation,I should be able to see only column 'G' ,'H' and 'Q'.

    etc..


    Please help me.
    Attached Files Attached Files

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Make columns visible/invisible as per the conditions

    I presume you're aware that if you hide columns it is applied to all rows (you can hide column E for one row and not another) ... the setup of your file would lead to me believe that your requirements are not viable.

  5. #5
    Registered User
    Join Date
    09-04-2009
    Location
    India
    MS-Off Ver
    Excel 2002
    Posts
    10

    Re: Make columns visible/invisible as per the conditions

    Hello,

    I dont mind, if I hide a particular column, all the rows would go hidden. All I need is , I dont want the unnecessary columns to be visible on selecting any option.

    Thanks in advance,
    deeps

  6. #6
    Registered User
    Join Date
    09-04-2009
    Location
    India
    MS-Off Ver
    Excel 2002
    Posts
    10

    Re: Make columns visible/invisible as per the conditions

    Hello all,

    Please help me on this issue.

    Thanks in advance,
    Deeps

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Make columns visible/invisible as per the conditions

    Deeps, "bumping" your post inside 30 minutes is unlikely to get people to respond any quicker (quite the contrary).

    You will need to utilise a Change event, below would reside in Sheet object - to insert right click on tab against which the code is to be applied - select View Code - paste below into resulting window.

    Please Login or Register  to view this content.
    You will of course need to add remaining conditions (you provided only three).

  8. #8
    Registered User
    Join Date
    09-04-2009
    Location
    India
    MS-Off Ver
    Excel 2002
    Posts
    10

    Re: Make columns visible/invisible as per the conditions

    Hello Donkeyote,

    Am sorry to trouble you again. I tried your code but it dint work. I have uploaded the sheet with your code below. Please advise.

    the req is below.

    Test case Creation : Show only E,P
    Test Case Modification: Show only F,P
    Test Scenario Creation: Show G, H
    Test Matrix:I,P
    Review:J,P
    System Test:K,L,M,N,P
    Retest:O,P
    Other:P

    Regards,
    Deeps
    Attached Files Attached Files

  9. #9
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Make columns visible/invisible as per the conditions

    The code does work I'm afraid - or at least it does what you asked... perhaps that's the problem ? ie you've since changed your requirements... you should be able to adapt the code to meet your own needs.
    Last edited by DonkeyOte; 09-04-2009 at 04:36 AM.

  10. #10
    Registered User
    Join Date
    09-04-2009
    Location
    India
    MS-Off Ver
    Excel 2002
    Posts
    10

    Re: Make columns visible/invisible as per the conditions

    Hello,

    I tried the code.Unfortunately it did not work for me.

    When I open the sheet for the first time, I should not be able to see any of the columns from E to P

    And I should be able to see appropriate columns on selecting options from Column C.

    The code is not doing it for me. I fear i have done something wrong. Please check the sheet uploaded along with this. Code is pasted in it. Please correct me if I have done it wrongly.

    Regards,
    Deeps
    Attached Files Attached Files

  11. #11
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Make columns visible/invisible as per the conditions

    Now x-posted: http://www.mrexcel.com/forum/showthread.php?t=414083

    Deeps, I've not answered because put simply you have what you need to resolve your question you just need to put in a little effort on your side.

  12. #12
    Registered User
    Join Date
    09-04-2009
    Location
    India
    MS-Off Ver
    Excel 2002
    Posts
    10

    Re: Make columns visible/invisible as per the conditions

    Sorry for the trouble caused. I tried to implement the code, but it dint work for me as am a beginner to excel macros.


    Quote Originally Posted by DonkeyOte View Post
    Now x-posted: http://www.mrexcel.com/forum/showthread.php?t=414083

    Deeps, I've not answered because put simply you have what you need to resolve your question you just need to put in a little effort on your side.

  13. #13
    Registered User
    Join Date
    09-04-2009
    Location
    India
    MS-Off Ver
    Excel 2002
    Posts
    10

    Re: Make columns visible/invisible as per the conditions

    Please help me!!

    Quote Originally Posted by deeps1403 View Post
    Sorry for the trouble caused. I tried to implement the code, but it dint work for me as am a beginner to excel macros.

+ 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