Normal Data sheet auto convert into pivot data sheet after auto Delete pivot sheet

VKMouli

New Member
Joined
Jul 28, 2022
Messages
14
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
  3. Web
Dear Experts,

Is there any VBA code exists -
Step-1 Normal Data sheet will be created into pivot Table,
Step-2 after that its auto copy the existing pivot Table fields into new work sheet with desired sheet name,
Step-3 later auto delete pivot table?

Looking your help??

Regards, V K Mouli
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
VBA Code:
Sub CreatePivotTable() 'Declare your variables 
Dim wb As Workbook 
Dim wsData As Worksheet 
Dim ws Pivot As Worksheet
 Dim pt As PivotTable 'Set the workbook and worksheets 
Set wb = ThisWorkbook Set wsData = wb.Worksheets("Data") 
Set wsPivot = wb.Worksheets("Pivot") 'Create the Pivot Table
 Set pt = wsData.PivotTableWizard 'Copy the Pivot Table to the new worksheet
 wsPivot.Range("A1").PasteSpecial xlPasteValues 'Delete the Pivot Table
 wsData.PivotTables(1).TableRange2.Clear 
End Sub.
 
Upvote 0
Solution

Forum statistics

Threads
1,215,465
Messages
6,124,971
Members
449,200
Latest member
Jamil ahmed

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top