Results 1 to 7 of 7
  1. #1
    2 Star Lounger
    Join Date
    May 2015
    Posts
    104
    Thanks
    15
    Thanked 0 Times in 0 Posts

    Execute Worksheet_change after sheet was updated via vba...

    Hi Guys,

    How can I trigger the updating of Sheet 2 after I changed the quantity via VBA using Qty from Sheet 1?
    Sheet 1 is active, Sheet 2 is in the background, if that makes a difference.
    Sheet 2 has a Worksheet_Change VBA that should update the page based on the new values just entered by the VBA.

    Thanks
    Ferenc

  2. #2
    3 Star Lounger
    Join Date
    Apr 2001
    Location
    Levin, Manawatu-Wanganui, New Zealand
    Posts
    324
    Thanks
    9
    Thanked 28 Times in 26 Posts
    Hi Ferenc

    Try this link and the section about running another macro.

    G

  3. #3
    2 Star Lounger
    Join Date
    May 2015
    Posts
    104
    Thanks
    15
    Thanked 0 Times in 0 Posts
    I already have the Worksheet_change VBA, but because I am updating the Qty cell via VBA from another sheet, it never gets triggered.
    That is that I am trying to figure out.

  4. #4
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    2,832
    Thanks
    136
    Thanked 484 Times in 461 Posts
    Hi Ferenc

    ..after you have updated the QTY on sheet 2 via vba, try adding these lines at the end of the routine that does the QTY update..

    Application.Screenupdating = False
    sht2.Activate
    sht1.Activate

    ..where sht2 and sht1 are the sheet codenames (change to match yours)

    zeddy
    •On-Demand Clinical Analyst
    .

  5. #5
    Gold Lounger Maudibe's Avatar
    Join Date
    Aug 2010
    Location
    Pa, USA
    Posts
    2,639
    Thanks
    115
    Thanked 651 Times in 593 Posts
    Ferenc,

    If this was based on your previous post, the code goes in the worksheet module of sheet 1 (where the change was made) not sheet 2

    Maud

  6. #6
    2 Star Lounger
    Join Date
    May 2015
    Posts
    104
    Thanks
    15
    Thanked 0 Times in 0 Posts
    Hi Guys,

    Am I correct thinking that

    Code:
    Application.Screenupdating = False
    sht2.Activate
    sht1.Activate
    is equivalent of me manually switching to sheet 2, then sheet 1?

    Reason I ask is because while I placed it at the end of the routine, and I verified it runs, "GmailCurrent" won't update or think that Qty was changed... I am out of ideas...

    Code:
    '...................................................................
    'Run GmailCurrent change VBA..
    '...................................................................
    Application.ScreenUpdating = False
    shtGC.Activate
    shtSK.Activate
    Is on the bottom of "Stock".
    Maybe one of you can see the reason...

    Trades 3.8.xlsm

  7. #7
    2 Star Lounger
    Join Date
    May 2015
    Posts
    104
    Thanks
    15
    Thanked 0 Times in 0 Posts
    Just moved the copy mechanism into the Qty update... Happy Days

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •