+ Reply to Thread
Results 1 to 12 of 12

hiding range of columns depending on a set value

  1. #1
    Registered User
    Join Date
    10-05-2006
    Location
    Gourock, Scotland
    Posts
    57

    hiding range of columns depending on a set value

    Hi What is wrong with this ... it does not appear to work. What am I missing.
    Trying to hide components depending on whats selected - colum P has the triggers.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    Perhaps this is what you are looking for?
    Please Login or Register  to view this content.
    Jason

  3. #3
    Registered User
    Join Date
    10-05-2006
    Location
    Gourock, Scotland
    Posts
    57

    More help with hiding columns

    Hi Jason,

    I've popped the sheet up ... still can't seem to get it working.
    Would you mind having a look.

    Thanks.

    Peter.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    Sorry, Peter, I cannot open that file, since I am using Office 97.

    Jason

  5. #5
    Registered User
    Join Date
    10-05-2006
    Location
    Gourock, Scotland
    Posts
    57

    97 version

    Sorry Jason - force of habit to save as 2007 file.
    try this one.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    10-05-2006
    Location
    Gourock, Scotland
    Posts
    57

    Need Help : activating code upon changes

    OK ...
    I have got my code doing what I want - well almost. I have had to set it up to use a command button to activate the code. How can I set it to change upon selection within sheet. IE A = Add ... blank is Remove it

    Please Login or Register  to view this content.

  7. #7
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    Sorry, Peter, I forgot about this thread.

    I included the following procedure in the Worksheet Change event handler, which will run the procedure whenever one of the applicable cells change:
    Please Login or Register  to view this content.
    HTH

    Jason
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    10-05-2006
    Location
    Gourock, Scotland
    Posts
    57

    Thanks

    Jason,

    You are a star, many thanks.

  9. #9
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    Actually, after looking at the code, this is a little shorter if you want to copy and paste over the other procedure:
    Please Login or Register  to view this content.
    Glad it helped.

    Jason

  10. #10
    Registered User
    Join Date
    10-05-2006
    Location
    Gourock, Scotland
    Posts
    57

    thanks

    I'll give that a try as well ... I made a mistook in the original - i got my hides and unhides the wrong way round. Fixed it by switching the True and False round.

    Really and truelly thanks for the help.


    MMM ... that new one, only shows 1 component at a time... I added the line below under the DIM's to hide all components, then depending on what's selected the component is unhidden.

    Please Login or Register  to view this content.
    Peter.
    Last edited by toeragh; 12-11-2007 at 12:02 PM.

  11. #11
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    Hi, Peter.

    That second procedure I posted will work properly, but only if the cells are changed individually. So if you were to copy one cell into several at the same time, you are correct in that it will not properly work.

    Instead of listing each range twice, I determined whether to hide them or not at the beginning, and assigning that True/False value to the variable bHide. So if the columns need to be hidden, bHide is True. Otherwise, bHide is False.
    It will apply the correct T/F value to the appropriate columns, but again, only if cells are changed individually.

    Based on your response that you had the T/F backwards, all you would need to do to correct the second procedure is swap the one set of T/F values.

    Jason

  12. #12
    Registered User
    Join Date
    10-05-2006
    Location
    Gourock, Scotland
    Posts
    57
    Hi Jason,

    yes mate that's what I done with the second batch of code, switched the T/F round.

    I have used some of the logic to create the effect i need. As I do need to show all selected components, not individuals.

    Peter.

+ 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