![]() |
pivottable or querytable
I want to determine if the current selection is a pivottable,
querytable or neither. Any ideas here? Thanks! Dave |
pivottable or querytable
You could check the active cell:
Sub CheckPivotAndQuery() Dim strPivot As String Dim strQuery As String On Error Resume Next strPivot = ActiveCell.PivotTable.Name strQuery = ActiveCell.QueryTable.Name On Error GoTo 0 If strPivot = "" And strQuery = "" Then MsgBox "No pivot table and no query" Else If strPivot < "" Then MsgBox strPivot Else MsgBox strQuery End If End If End Sub Dave wrote: I want to determine if the current selection is a pivottable, querytable or neither. Any ideas here? Thanks! Dave -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html |
pivottable or querytable
Exactly what I needed. Thanks Debra!
|
All times are GMT +1. The time now is 01:52 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com