ahhhhh i see what you are talking about wiht the On_Open concept....but i already have a code that runs on open....i know i can add it to the code but let me explain how it all works......
here is the current on open code (i think you helped me with it a few days ago)
Code:
'ReFresh Named Range on Sheet1 to Current Region
'Sheet1="CompiliedMaster" for CPS Doc
ActiveWorkbook.Names.Add Name:="PRange", RefersTo:=Worksheets("CompiliedMaster").Range("B4").CurrentRegion
'ReFresh Pivot Table on Sheet2
'Sheet2="CompiledMasterPivot" for CPS Doc
For Each pvt In Worksheets("CompiledMasterPivot").PivotTables
pvt.PivotCache.Refresh
Next pvt
End Sub
the order of how this works currently is:
i have a code in another file that opens a 2nd file and uploads data to CompiliedMaster sheet. therefore i need to have the active sheet to always be CompiliedMaster do the data is updated to the correct sheet.
a 2nd sheet in the .xls contain a pivot witch uses "CompiliedMaster" data for it's source.
so i was thinking On Close => makes CompiliedMaster as the active sheet (then the new days data is auto updated in the correct sheet).
then On Open = > refresh pivot with the new data from CompiliedMaster.
any suggestions on streamlining this concept?