Auto Trigger Macro to Sort using VBA

Holbie

New Member
Joined
Nov 17, 2020
Messages
4
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
  3. Web
So I used this method posted about 6 months ago to create a triggered macro to sort a table that updates based on queried data and new calculations.

It was working fine this morning, I came back from lunch and it is now broken.

I changed nothing at all but it will not sort now when the data changes in the table. Can anyone help with this please. below is my macro trigger, The macros themself will run and perform the desired sort when triggered manually, but do not auto sort the table when the ranking changes now.

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)


    If Not Intersect(Target, Range("Site_DB")) Is Nothing Then
        Macro3
    End If
    
    If Not Intersect(Target, Range("Team_DB")) Is Nothing Then
        Macro1
    End If
    
End Sub

There are two tables with dynamic data tied to a larger data table the queries a cube on our server and a few other reports that overwrite to a static location. Why will this no longer trigger the appropriate macros to run when the data in the tables chagne?
 

Some videos you may like

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Logit

Well-known Member
Joined
Aug 31, 2016
Messages
3,797
Make certain "Site_DB" and "Team_DB" still exist ...
 

Holbie

New Member
Joined
Nov 17, 2020
Messages
4
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
  3. Web
Make certain "Site_DB" and "Team_DB" still exist ...

1605647208872.png

yep still defined tables. they are full of lookup and calculate formulas with the ranking column being my desired column to keep in order.
 

Logit

Well-known Member
Joined
Aug 31, 2016
Messages
3,797
Has your computer been shut down and restarted since you returned from lunch ? Maybe it just needs a boot in the ...
 

Holbie

New Member
Joined
Nov 17, 2020
Messages
4
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
  3. Web
Has your computer been shut down and restarted since you returned from lunch ? Maybe it just needs a boot in the ...
Just restarted and haven't had any data Update as of yet, to try again.

does the VBA look correct to be triggered by a change in the table?
 

Logit

Well-known Member
Joined
Aug 31, 2016
Messages
3,797
It does at first glance. But I haven't tested it here.
If it worked before and you haven't changed anything then ....
 

Watch MrExcel Video

Forum statistics

Threads
1,118,774
Messages
5,574,157
Members
412,574
Latest member
shadowfighter666
Top