I think this is going to be an easy one for those you have been dealing with Excel, VB and Pivot tables for longtime. I am sort of new and pushed into MS Sql server and now dealing with a report that has a column called SnapshotDt which users use to pull up historical data and we are using a excel template and refreshing this template daily with new data hence the snapshotdt column gets new dates very day. But the issue is the template is set for a particular date because one date has to be selected. Now users want me to dynamically update this sndpshotdt to the latest date when we run the refresh step which is where my issue is. I can do this manually by recording a macro but I need this done on daily basis which is where I am getting stuck and as was wondering if some one can take a look at this Macro and help me update the .&[ piece to pick up the latest date automatically.
' test4 Macro
"'[Dim].[SnapshotDt].[SnapshotDt]'[All]", xlDataAndLabel, True
"[Dim].[SnapshotDt].[SnapshotDt]").VisibleItemsList = Array( _
"[Dim].[SnapshotDt].&[2009-12-13T00:00:00]") - this 2009-12-13 needs to be replaced with a variable where this macro can get the latest date from snapshotdtand that's gets selected
Any help on this will be a great