S
Shell
I have written some code in Excel 2000. COde shown below.
Private Sub Worksheet_Activate()
Dim pvt As PivotTable
Dim i As Long
Dim d As Variant
Dim rge As Range
If gblnSheet3Executed = True Then
Exit Sub
End If
'Get max row
i = 1
d = 1
Do Until d = ""
i = i + 1
d = Sheet4.Range("A" & i).Value
Loop
'Refresh the pivot table
For Each pvt In Me.PivotTables
pvt.SourceData = Sheets("AbbreviatedRawData").Range("A1:H" & i -
1).CurrentRegion.Address(True, True, xlR1C1, True)
pvt.RefreshTable
gblnSheet3Executed = True
Next pvt
End Sub
I need to run this code in in Access 2000 instead. I know I won't need the
first if statement. But I don't know how to implement this code in Access.
Can someone direct me?
Thanks
Private Sub Worksheet_Activate()
Dim pvt As PivotTable
Dim i As Long
Dim d As Variant
Dim rge As Range
If gblnSheet3Executed = True Then
Exit Sub
End If
'Get max row
i = 1
d = 1
Do Until d = ""
i = i + 1
d = Sheet4.Range("A" & i).Value
Loop
'Refresh the pivot table
For Each pvt In Me.PivotTables
pvt.SourceData = Sheets("AbbreviatedRawData").Range("A1:H" & i -
1).CurrentRegion.Address(True, True, xlR1C1, True)
pvt.RefreshTable
gblnSheet3Executed = True
Next pvt
End Sub
I need to run this code in in Access 2000 instead. I know I won't need the
first if statement. But I don't know how to implement this code in Access.
Can someone direct me?
Thanks