eldeanos78
New Member
- Joined
- Oct 29, 2009
- Messages
- 1
Hello,
Could anybody help with a VBA query? I am using the below code to automatically refresh a pivot table everytime cell A1 changes. The only problem is A1 is a formula and as such if the value changes the code assumes nothing has happened. Can VBA recognise cell formula changes?
Private Sub Worksheet_Change(ByVal Target As Range)
Dim pt As PivotTable
If Target(1, 1).Address = "$A$1" Then
For Each pt In Me.PivotTables
pt.RefreshTable
Next pt
End If
End Sub
Any help much appreciated.
D
Could anybody help with a VBA query? I am using the below code to automatically refresh a pivot table everytime cell A1 changes. The only problem is A1 is a formula and as such if the value changes the code assumes nothing has happened. Can VBA recognise cell formula changes?
Private Sub Worksheet_Change(ByVal Target As Range)
Dim pt As PivotTable
If Target(1, 1).Address = "$A$1" Then
For Each pt In Me.PivotTables
pt.RefreshTable
Next pt
End If
End Sub
Any help much appreciated.
D