Charting 2003 to 97.

C

Cameron

Hi all,

Have created an XLS in 2003 that works well.
Not having used PivotTables or PivotCharts prior,
I've managed to do what I intended. Update the
raw-data, PivotTables and respective charts.
That's in 2003, sadly the charts won't update in
97 and this is where I'm needing assistance.
I've little VBA experience and realistically have
stumbled my through this little project; but
learning where and when I can.

Again, any assistance in updating the charts in
a Excel-97 environment would be appreciated.

Cheers,
Cameron
*************************************************
Private Sub CmdBtn1_Click()
'
' Sub: CmdBtn1_Click
' Author: Cameron Young
' Created: 13/10/2004
' ----------------------------------------
' Description: Refer comments.

'Invoke SrtRawData() Module
SrtRawData

'Re-sort PivotTable-1
UpdatePvtTbls

End Sub

Private Sub CmdBtn2_Click()
'
' Sub: CmdBtn2_Click
' Author: Cameron Young
' Created: 13/10/2004
' ----------------------------------------
' Description: Refer comments.

'PrintPreview / Print RawData as req.
Worksheets("SHFR").Range("A10").Select
Worksheets("SHFR").Range("A10").CurrentRegion.PrintPreview

'Go back to main worksheet and sit selected cell at bottom of listing
LastRow =
ThisWorkbook.Worksheets("SHFR").Range("CurrentList").End(xlDown).Row + 1
ThisWorkbook.Worksheets("SHFR").Range("A" & LastRow).Select

End Sub

Private Sub CmdBtn3_Click()
'
' Sub: CmdBtn3_Click
' Author: Cameron Young
' Created: 13/10/2004
' ----------------------------------------
' Description: Refer comments.

'PrintPreview / Print PivotTable Charts as req.
Charts(1).Activate
ActiveChart.PrintPreview
Charts(2).Activate
ActiveChart.PrintPreview
Worksheets("SHFR").Activate

'Go back to main worksheet and sit selected cell at bottom of listing
LastRow =
ThisWorkbook.Worksheets("SHFR").Range("CurrentList").End(xlDown).Row + 1
ThisWorkbook.Worksheets("SHFR").Range("A" & LastRow).Select

End Sub

Public Sub SrtRawData()
'
' Macro: SrtRawData
' Author: Cameron Young
' Created: 13/10/2004
' ----------------------------------------
' Description: Refer comments.
'
' Select cell A10 of sheet &
' sort CurrentRegion data.
LastRow =
ThisWorkbook.Worksheets("SHFR").Range("CurrentList").End(xlDown).Row + 1
Worksheets("SHFR").Range("A10").Select
Worksheets("SHFR").Range("A10").CurrentRegion.Sort _
Key1:=Worksheets("SHFR").Range("A10"), _
Header:=xlYes

' Rebuild Named Ranges that have been expanded.
ActiveWorkbook.Names.Add Name:="CurrentList", _
RefersTo:="='SHFR'!$A$10:$A$" & LastRow
ThisWorkbook.Worksheets("SHFR").Range("A" & LastRow).Select

End Sub

Public Sub UpdatePvtTbls()
'
' Macro: UpdatePvtTbl1
' Author: Cameron Young
' Created: 13/10/2004
' ----------------------------------------
' Description: Refer comments.
'
'Re-sort PvtTbl1 & PvtTbl2
Worksheets("PvtTbls").Select
ActiveSheet.PivotTables("PvtTbl1").PivotCache.Refresh
ActiveSheet.PivotTables("PvtTbl2").PivotCache.Refresh

Worksheets("SHFR").Activate
'Go back to main worksheet and sit selected cell at bottom of listing
LastRow =
ThisWorkbook.Worksheets("SHFR").Range("CurrentList").End(xlDown).Row + 1
ThisWorkbook.Worksheets("SHFR").Range("A" & LastRow).Select

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top