ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Pivot table - remove worksheet (https://www.excelbanter.com/excel-worksheet-functions/135975-pivot-table-remove-worksheet.html)

Greg

Pivot table - remove worksheet
 
When I double click a cell in a pivot table the data shows on a new
worksheet. How can I have this worksheet 'delete' when moving to another
worksheet in the workbook?
Thanks, Greg

Debra Dalgleish

Pivot table - remove worksheet
 
You could use programming to delete the sheets. If no other sheet names
start with "Sheet", you could use code similar to this in the
ThisWorkbook module:

'====================
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If Left(ws.Name, 5) = "Sheet" Then
If ws.Name < ActiveSheet.Name Then
Application.DisplayAlerts = False
ws.Delete
Application.DisplayAlerts = True
End If

End If
Next ws
End Sub
'=========================

Greg wrote:
When I double click a cell in a pivot table the data shows on a new
worksheet. How can I have this worksheet 'delete' when moving to another
worksheet in the workbook?
Thanks, Greg



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html


Greg

Pivot table - remove worksheet
 
Debra,
Perfect-O! I was hoping for something like that.
Thanks, Greg

"Debra Dalgleish" wrote:

You could use programming to delete the sheets. If no other sheet names
start with "Sheet", you could use code similar to this in the
ThisWorkbook module:

'====================
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If Left(ws.Name, 5) = "Sheet" Then
If ws.Name < ActiveSheet.Name Then
Application.DisplayAlerts = False
ws.Delete
Application.DisplayAlerts = True
End If

End If
Next ws
End Sub
'=========================

Greg wrote:
When I double click a cell in a pivot table the data shows on a new
worksheet. How can I have this worksheet 'delete' when moving to another
worksheet in the workbook?
Thanks, Greg



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html



Debra Dalgleish

Pivot table - remove worksheet
 
You're welcome!

Greg wrote:
Debra,
Perfect-O! I was hoping for something like that.
Thanks, Greg

"Debra Dalgleish" wrote:


You could use programming to delete the sheets. If no other sheet names
start with "Sheet", you could use code similar to this in the
ThisWorkbook module:

'====================
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If Left(ws.Name, 5) = "Sheet" Then
If ws.Name < ActiveSheet.Name Then
Application.DisplayAlerts = False
ws.Delete
Application.DisplayAlerts = True
End If

End If
Next ws
End Sub
'=========================

Greg wrote:

When I double click a cell in a pivot table the data shows on a new
worksheet. How can I have this worksheet 'delete' when moving to another
worksheet in the workbook?
Thanks, Greg



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html





--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html



All times are GMT +1. The time now is 04:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com