I created a PivotTable from a query using the following. The SQL pulls a start and end date that the user enters on a worksheet. How can I refresh the PivotTable/PivotCache instead of creating it (PivotCaches.Add)?
If rst.RecordCount <= 1 Then
' Create Pivot Table
Set objPivotCache = ActiveWorkbook.PivotCaches.Add(SourceType:=xlExternal)
Set objPivotCache.Recordset = rst
.CreatePivotTable TableDestination:=Range("A5"), TableName:="TotalContractorResults"
.Orientation = xlRowField
.Position = 1
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
How can you see what you are working on when you want to see it while you to save a copy?
Add a "Save As" icon to the Quick Access Toolbar, or QAT.
That way, when you save a copy of a query, form, report, or other object you are modifying, you…