If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Pivot Tables....

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-24-04, 16:43
nmci_dmar nmci_dmar is offline
Registered User
 
Join Date: Feb 2004
Posts: 3
Pivot Tables....

Hello All,
I am trying to use VBA to Import a CSV file into my excel book then Auto Update my Pivot Tables. So far this works Great. But I have one question. I have 2 Pivot tables that are date sensative. IE Isses Over 30 days old, Issues over 20 days old. Each time I refresh the Pivots I have to manualy uncheck the Display of Issues that are within these specs. Is there a VBA way to tell Excel not to show issues within 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

Thanks
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On