+ Reply to Thread
Results 1 to 7 of 7

ComboBox Linked Cell change does not trigger hiding/unhiding of columns

  1. #1
    Forum Contributor
    Join Date
    05-23-2014
    Location
    Fredericia, Denmark
    MS-Off Ver
    Windows Office 2013, Excel 10
    Posts
    139

    ComboBox Linked Cell change does not trigger hiding/unhiding of columns

    I'm using an Active X combobox ("GLC_Code") to reference a list of staff codes and have assigned a cell ("D1") to match whatever is selected in the combobox. Based on what is in "D1" different columns should hide/unhide. Except they don't....However, if I make a change in the combobox then double click in the (also changed/matching) linked cell and then double click in any other cell then the hiding/unhiding event is triggered, as scripted. I'm pretty sure I'm overlooking something simple but the neurons aren't firing well today. Here is my code:

    Please Login or Register  to view this content.
    Also, I tried several configurations to list the series of columns in one line but nothing worked. Suggestions?


    Thanks for your help. David

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: ComboBox Linked Cell change does not trigger hiding/unhiding of columns

    Hi David,

    The easiest way is probably to change the Worksheet_Change() event to a ComboBox Change Event "GLC_Code_Change(). Your code didn't work because cell 'D1' changed based on a formula and that does not generate a 'Change Event'. It generates a 'Calculate Event'. The 'Calculate Event' does not have a 'Target' cell, so a good deal of additional code is required to determine if cell 'D1' changed. If you're interested in how this works, see the file associated with post #3 in the following thread: http://www.excelforum.com/excel-prog...ionchange.html

    There are more efficient ways to list a series of columns, but I prefer the way you have it, because I think it is very easy to read.

    Lewis
    Last edited by LJMetzger; 12-10-2014 at 05:48 PM. Reason: Added Worksheet_Calculate() info

  3. #3
    Forum Contributor
    Join Date
    05-23-2014
    Location
    Fredericia, Denmark
    MS-Off Ver
    Windows Office 2013, Excel 10
    Posts
    139

    Re: ComboBox Linked Cell change does not trigger hiding/unhiding of columns

    I don't understand, sorry. I reviewed the third post from the link you forwarded but it didn't seem to fit exactly what I am (trying) to do. My problem is that nothing happens (no columns hide/unhide) when the content (text, not numerical values) of the cell linked to a ComboBox changes (when a different listing in that Combobox is selected.) If I double click in the linked cell and then double click in any other cell, then the hiding/unhiding works. Specifically, what am I doing wrong with my code, please?

    I'm sure this is a very basic question but I've searched for several hours online and have found nothing that works. I'm very frustrated...

    Thanks for your help. David

  4. #4
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: ComboBox Linked Cell change does not trigger hiding/unhiding of columns

    Hi David,

    I did all that I could with the code you provided. For additional help, you're going to have to upload a sample workbook, that contains your code in context.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

    Lewis

  5. #5
    Forum Contributor
    Join Date
    05-23-2014
    Location
    Fredericia, Denmark
    MS-Off Ver
    Windows Office 2013, Excel 10
    Posts
    139

    Re: ComboBox Linked Cell change does not trigger hiding/unhiding of columns

    Here is the document. It's pretty brief. Note the location of the cell is, purely by coincidence, "U2".... not "D1" as indicated in my original inquiry.

    Thanks for your help Lewis. I really appreciate it. David
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: ComboBox Linked Cell change does not trigger hiding/unhiding of columns

    Hi David,

    Try this in the Scorecard_New module. It worked for me. If it doesn't work, we have to:
    a. Verify the properties in the Combobox (i.e. linked cell, and make sure it triggers the GlC_Code_Change() event()).
    b. Make sure the Sheet isn't corrupt.

    The Worksheet_Change() event is not triggered when 'U2' changes, because a formula changes the value of 'U2'. However, when the ComboBox changes value, the GLC_Code_Change() event is triggered. I had to make minimal changes to make it work. Changes in red.


    Please Login or Register  to view this content.
    Lewis

  7. #7
    Forum Contributor
    Join Date
    05-23-2014
    Location
    Fredericia, Denmark
    MS-Off Ver
    Windows Office 2013, Excel 10
    Posts
    139

    Re: ComboBox Linked Cell change does not trigger hiding/unhiding of columns

    Shazam! That did it. Thanks for your Lewis. You rock. David

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Hiding/Unhiding Columns referencing a cell with a formula
    By nabeel.pnm in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-16-2012, 03:00 AM
  2. Hiding unhiding columns
    By ABSTRAKTUS in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-17-2010, 11:24 AM
  3. Hiding and Unhiding Entire Columns based on Cell Reference
    By montego in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-02-2010, 01:25 PM
  4. Hiding / Unhiding rows when multiple cell values change
    By waverider in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-09-2006, 08:35 AM
  5. Hiding/Unhiding Columns
    By xkarenxxxx in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-05-2006, 09:25 AM

Tags for this Thread

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