+ Reply to Thread
Results 1 to 3 of 3

Macro won't fire on sheet change with query refresh

  1. #1
    Forum Contributor
    Join Date
    12-06-2012
    Location
    sacramento,calif
    MS-Off Ver
    Excel 2010
    Posts
    217

    Macro won't fire on sheet change with query refresh

    This is my code, a query refresh changes the values on the screen which I want to trigger the macro but it doesn't?


    Private Sub Worksheet_Change(ByVal Target As Range)
    If Range("AA7") <> Range("AA8") And Range("E2") = "ON" Then

    Run ("MACRO1")


    Else
    Exit Sub
    End If
    End Sub

  2. #2
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Macro won't fire on sheet change with query refresh

    Code worked for me. Did you put it in the sheet module?

  3. #3
    Forum Contributor
    Join Date
    12-06-2012
    Location
    sacramento,calif
    MS-Off Ver
    Excel 2010
    Posts
    217

    Re: Macro won't fire on sheet change with query refresh

    yes its in the sheet module, and it will work if you manually make a change but i need it to change with a refresh and no manual user input

+ 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. Replies: 8
    Last Post: 10-30-2010, 08:07 PM
  2. Macro to refresh query.
    By CJPHX in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-20-2010, 01:47 PM
  3. Refresh Query by Name, not by Sheet().Range().QueryTable
    By Whizbang in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-17-2009, 04:59 PM
  4. Query does not refresh if sheet protected
    By sumdumgai in forum Excel General
    Replies: 0
    Last Post: 09-17-2008, 12:10 PM
  5. [SOLVED] While sheet is protected, allow cmdButton to refresh query.
    By mhng in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-17-2006, 01:00 PM

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