+ Reply to Thread
Results 1 to 7 of 7

Worksheet_change event (not working to execute filter)

  1. #1
    Registered User
    Join Date
    05-18-2015
    Location
    Bratislava
    MS-Off Ver
    Office 2007
    Posts
    33

    Worksheet_change event (not working to execute filter)

    Hello guys.

    Would you please help me with one thing ? My goal is to run macro based on Worksheet_change event. My target cell is being updated based on hyperlink function.
    So at first, I have this function >>

    Please Login or Register  to view this content.
    I thought, that when G2 cell is updated (based on selection), then I can use Worksheet_change event, but it seems this is not possible. Here is my code which doesn't work as intended >>

    Please Login or Register  to view this content.
    If I click on G2 and manually change content, it works, but when I use hyperlink function to update G2, it doesn't work.
    Please, do you know if I can somehow get around this ?? I would like to use Hyperlink method, is it looks pretty professional and elegant.

    I use MSO 2010.

    thanks a lot.

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Worksheet_change event (not working to execute filter)

    Maybe if you change the Function to a Sub
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    05-18-2015
    Location
    Bratislava
    MS-Off Ver
    Office 2007
    Posts
    33

    Re: Worksheet_change event (not working to execute filter)

    Ho xladept.
    I doubt this will help:-( Purpose of using Function is that I need to have some outcome (value).
    Please, see below file. Purpose fo Hyperlink function is that user will just put his mouse over arrows (2. tab, line 2) and cell G2 will be automatically updated.
    Thus I suppose I need to use Function and not Sub.

    But despite G2 cell has different content, it doesn't trigger event, and thus macro. Only when I click on G2 and manually change it to something else, event/macro is executed.
    Attached Files Attached Files

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Worksheet_change event (not working to execute filter)

    Well, your code is Function in name only (FINO?) that's why I suggested Sub and you can't expect a function to actually do anything.

    Please Login or Register  to view this content.
    * I think that's what it would look like as a function

  5. #5
    Registered User
    Join Date
    05-18-2015
    Location
    Bratislava
    MS-Off Ver
    Office 2007
    Posts
    33

    Re: Worksheet_change event (not working to execute filter)

    But result is the same. Purpose of function either the way I wrote or what you wrote is the same....to update cell G2 (in second tab), when user put mouse over cells B2:F2.
    So when mouse is put over cell B2, then B1 value ("BA") is put as G2 value. Regardless if your method or my method is used, result is the same.

    but problem is that this type of update of G2 cell doesn't trigger macro/worksheet_change event. I read somwhere, but don't remember where, that this type of cell update (using hyperlink method) doesn't trigger event. Why I posted this question here is, that it's seems to me strange...

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Worksheet_change event (not working to execute filter)

    This triggered:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    05-18-2015
    Location
    Bratislava
    MS-Off Ver
    Office 2007
    Posts
    33

    Re: Worksheet_change event (not working to execute filter)

    That's right, but please, is possible to avoid creation of another Procedure (above it's TestFun() ) ?
    Because Function above already updates G2 cell....why this update isn't sufficient to trigger event ?
    This function is called by functions placed in cells B2 : F2. Beauty of this solution would be that user doesn't need to run any macro explicitely.

    I understand that Function by itself doesn't do anything. My type of solution is to call this function by standard functions written normally in cells B2:F2. Your solution is to call function by another procedure. I am just curious why my way of calling Function doesn't trigger event and your way of solution yes....if in both ways cell G2 is updated.

    But still thanks a lot for help ! I will not tackle this more and will take it as it is:-)
    Last edited by Rudo123; 03-26-2016 at 04:17 PM.

+ 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. worksheet_change event stops working
    By kutach770 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-12-2023, 12:21 PM
  2. Worksheet_Change Event not working
    By dgibney in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-13-2015, 02:21 PM
  3. [SOLVED] worksheet_Change event not working as intended.
    By Kramxel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-07-2015, 04:00 AM
  4. [SOLVED] Worksheet_Change event - second part not working since Target is already being defined
    By ther3cruit in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-14-2015, 04:01 PM
  5. Worksheet_Change Event does not execute upon change of cell
    By KarlaM in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-11-2013, 07:04 PM
  6. Worksheet_Change event not working on xl2003
    By matrex in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-29-2008, 12:38 PM
  7. Execute code from the Worksheet_Change event
    By aldredd in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-17-2008, 05:52 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