Pivot Tables....

N

nmci_dmar

Hello All,
I am trying to use VBA to Import a CSV file into my excel boo
then Auto Update my Pivot Tables. So far this works Great. But I hav
one question. I have 2 Pivot tables that are date sensative. IE Isse
Over 30 days old, Issues over 20 days old. Each time I refresh th
Pivots I have to manualy uncheck the Display of Issues that are withi
these specs. Is there a VBA way to tell Excel not to show issues withi
these specs on refresh. I have included my code just for reference...

Public Sub UpdateReport()

'runs the query when Update button is clicked

Call ClearCells 'Clears the Ticket Data
Call ImportCSV

End Sub

Public Sub ClearCells()

Dim ClearRange As Range

Set ClearRange = Sheet9.Range("A1:R1000")

ClearRange.ClearContents


End Sub
Public Sub ImportCSV()


With Sheet9.QueryTables.Add( _
Connection:="TEXT;C:\Case Reports\WIP CSV's\report.csv", _
Destination:=Sheet9.Range("A1"))
.RefreshStyle = xlInsertDeleteCells
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileCommaDelimiter = True
.Refresh BackgroundQuery:=False
End With

Sheet1.PivotTables("ByGroup").RefreshTable
Sheet2.PivotTables("ByType").RefreshTable
Sheet3.PivotTables("ByBase").RefreshTable
Sheet4.PivotTables("BasebyMachine").RefreshTable
Sheet5.PivotTables("BlueScreen").RefreshTable
Sheet6.PivotTables("Over20").RefreshTable
Sheet7.PivotTables("Over30").RefreshTable


End Sub

Thank
 

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