Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
PivotTables
How can you check in VBA code whether a sheet of data has already a pivot
table attached to it (on the same sheet or on a separate sheet)? Thank you in advance for any help. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
PivotTables
You can count the pivot tables, e.g.:
If ActiveSheet.PivotTables.Count Then MsgBox "There is a pivot table" Else MsgBox "There are no pivot tables" End If Gerry Verschuuren wrote: How can you check in VBA code whether a sheet of data has already a pivot table attached to it (on the same sheet or on a separate sheet)? Thank you in advance for any help. -- Debra Dalgleish Contextures http://www.contextures.com/tiptech.html |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
PivotTables
Unfortunately, that code only works when you are on the sheet that has a
pivottable on it, but not for tables on sheets separated from the original data "Debra Dalgleish" wrote: You can count the pivot tables, e.g.: If ActiveSheet.PivotTables.Count Then MsgBox "There is a pivot table" Else MsgBox "There are no pivot tables" End If Gerry Verschuuren wrote: How can you check in VBA code whether a sheet of data has already a pivot table attached to it (on the same sheet or on a separate sheet)? Thank you in advance for any help. -- Debra Dalgleish Contextures http://www.contextures.com/tiptech.html |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
PivotTables
Then either activate the sheet (Worksheets("whatever").Activate), or just use
the sheet's name directly (Worksheets("whatever").PivotTables.Count). -- * Please click Yes if this was helpful * Andy Smith Senior Systems Analyst Standard and Poor''s, NYC "Gerry Verschuuren" wrote: Unfortunately, that code only works when you are on the sheet that has a pivottable on it, but not for tables on sheets separated from the original data "Debra Dalgleish" wrote: You can count the pivot tables, e.g.: If ActiveSheet.PivotTables.Count Then MsgBox "There is a pivot table" Else MsgBox "There are no pivot tables" End If Gerry Verschuuren wrote: How can you check in VBA code whether a sheet of data has already a pivot table attached to it (on the same sheet or on a separate sheet)? Thank you in advance for any help. -- Debra Dalgleish Contextures http://www.contextures.com/tiptech.html |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
PivotTables
Is there just one worksheet with data in the workbook? Are you trying to
determine if a pivot table has been created from that data, somewhere in the same workbook? Gerry Verschuuren wrote: Unfortunately, that code only works when you are on the sheet that has a pivottable on it, but not for tables on sheets separated from the original data "Debra Dalgleish" wrote: You can count the pivot tables, e.g.: If ActiveSheet.PivotTables.Count Then MsgBox "There is a pivot table" Else MsgBox "There are no pivot tables" End If Gerry Verschuuren wrote: How can you check in VBA code whether a sheet of data has already a pivot table attached to it (on the same sheet or on a separate sheet)? Thank you in advance for any help. -- Debra Dalgleish Contextures http://www.contextures.com/tiptech.html -- Debra Dalgleish Contextures http://www.contextures.com/tiptech.html |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
PivotTables | Excel Discussion (Misc queries) | |||
Interactive PivotTables on the Web | Excel Discussion (Misc queries) | |||
Sorting in pivottables | Excel Worksheet Functions | |||
Format Pivottables? | Excel Discussion (Misc queries) | |||
New to Pivottables- need help | Charts and Charting in Excel |