Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
refer to current file name in PivotCaches.Add
I need pass the file name of the open file to the code below where it
says MyCurrentFileName. How do I do this? I need to create a pivot table based on the data in an open worksheet. The macro is store in my personal macro area. ActiveWorkbook.PivotCaches.Add(SourceTy pe:=xlDatabase, SourceData:= _ "TempSpace!R1C1:R2000C15").CreatePivotT able TableDestination:= _ "'[MyCurrentFileName.xls]MyPivot'!R1:R65536" _ , TableName:="PivotTable1", DefaultVersion:=xlPivotTableVersion10 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
refer to current file name in PivotCaches.Add
if it's the active workbook add
Dim aWB as WOrkbook Set aWB = ActiveWorkbook TableDestination:= _ "'[" & aWB.name & "]MyPivot'!R1:R65536" _ , TableName:="PivotTable1", "jo" wrote: I need pass the file name of the open file to the code below where it says MyCurrentFileName. How do I do this? I need to create a pivot table based on the data in an open worksheet. The macro is store in my personal macro area. ActiveWorkbook.PivotCaches.Add(SourceTy pe:=xlDatabase, SourceData:= _ "TempSpace!R1C1:R2000C15").CreatePivotT able TableDestination:= _ "'[MyCurrentFileName.xls]MyPivot'!R1:R65536" _ , TableName:="PivotTable1", DefaultVersion:=xlPivotTableVersion10 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Refer to current row in formula | Excel Worksheet Functions | |||
Refer to the worksheet containing the current running code | Excel Programming | |||
How refer to current date in Excel SQL query? | Excel Programming | |||
How to refer to current column in a formula? | Excel Discussion (Misc queries) | |||
how to I refer to current workbook without using its name? | Excel Worksheet Functions |