+ Reply to Thread
Results 1 to 6 of 6

When changing a cell on table in Sheet1, index match vba function doesnt trigger in sheet2

  1. #1
    Registered User
    Join Date
    11-04-2012
    Location
    İstanbul, Turkey
    MS-Off Ver
    Excel 2010
    Posts
    26

    Lightbulb When changing a cell on table in Sheet1, index match vba function doesnt trigger in sheet2

    Hi, i have this code. In sheet1, there is a table called auto_price_list (in macro screen this is range("a1:dd10000")) for example audi a4 price.

    While i am in sheet2, i am writing this function referencing Sheet1.range("a1:dd10000") (i do this with "index_func1()" with a vba code), and it works perfectly. when i change the data in sheet2 (for example sheet2!Z5="Audi A4" to sheet2!Z5="Audi A4") it works again too. thus far there is not a problem i am facing with.

    However,

    1- when i change a cell value on table in Sheet1, the function on Sheet2 doesn't trigger. (for example: Audi A4 is in Sheet1!A7 and i copy it to Sheet1!A12)

    2- Other thing is when i replace the value in Sheet1!B7 (for example Sheet'A7 is Audi A4 and Sheet1!B7 is 40000, and i change 40000 to 30000 in Sheet1!B7) corresponding to Sheet1!A7, the VBA function in Sheet2 does not trigger.

    What needs to be done to solve this problems? Thanks in advance.

    My macro codes are:

    Please Login or Register  to view this content.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: When changing a cell on table in Sheet1, index match vba function doesnt trigger in sh

    I believe you missed worksheetfunction.

    It should be

    application.WorksheetFunction.Match

    or

    WorksheetFunction.Match


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    11-04-2012
    Location
    İstanbul, Turkey
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: When changing a cell on table in Sheet1, index match vba function doesnt trigger in sh

    Hi, sixthsense, thanks for response, i changed the code, but still same problem happens.

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: When changing a cell on table in Sheet1, index match vba function doesnt trigger in sh

    The above suggestion is applicable for index function also have you done it. If so please show the revised code to us.

    Sent from mobile device

  5. #5
    Registered User
    Join Date
    11-04-2012
    Location
    İstanbul, Turkey
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: When changing a cell on table in Sheet1, index match vba function doesnt trigger in sh

    the revised code:

    Please Login or Register  to view this content.

  6. #6
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: When changing a cell on table in Sheet1, index match vba function doesnt trigger in sh

    A UDF only recalculates when one of its inputs gets changed. Since the data on Sheet1 is not an INPUT to the function, it does not recalculate.

    Adding
    Application.Volatile.True
    should cause it to recalculate, but it will do so for any change.

    Or you could add a Range input to your function which when called from your worksheet is the Sheet1 table. You don't have to do anything with it in your formula except define it as an input.

    Both solutions may degrade your system performance.
    Last edited by Pauleyb; 12-19-2012 at 11:11 AM.
    Pauley
    --------
    If I helped with your issue, I'd appreciate a rep bump (hit the '*' icon to the bottom left of this post).

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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