Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-27-2017, 05:19 AM
Bob123456789 Bob123456789 is offline Need Help Macro That Uses Pivot Table to Create New Sheet Windows 7 64bit Need Help Macro That Uses Pivot Table to Create New Sheet Office 2010 32bit
Novice
Need Help Macro That Uses Pivot Table to Create New Sheet
 
Join Date: Feb 2017
Posts: 10
Bob123456789 is on a distinguished road
Default Need Help Macro That Uses Pivot Table to Create New Sheet


I am trying to write a macro to automate a process that happens every day.

Every day a pivot table gets some new data which is manually refreshed. This pivot table creates a new sheet by the user double clicking on the “Grand_Total and “Grand_Total” cell. I need to delete the old sheet created yesterday, create a new sheet using today’s data then rename my new sheet all inside my macro.
How do I do this?

Thanks.
Reply With Quote
  #2  
Old 02-27-2017, 10:11 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Need Help Macro That Uses Pivot Table to Create New Sheet Windows 7 64bit Need Help Macro That Uses Pivot Table to Create New Sheet Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,780
Pecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant future
Default

Hi
do you mean that the old data is entirely discarded and only the n ew data is taken into account?
Also if a new sheet is created by clicking on a cell, I suppose a macro is running? Could you please post a sample sheet showing data and containing macro?
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
  #3  
Old 02-27-2017, 11:21 AM
Bob123456789 Bob123456789 is offline Need Help Macro That Uses Pivot Table to Create New Sheet Windows 7 64bit Need Help Macro That Uses Pivot Table to Create New Sheet Office 2010 32bit
Novice
Need Help Macro That Uses Pivot Table to Create New Sheet
 
Join Date: Feb 2017
Posts: 10
Bob123456789 is on a distinguished road
Default

There is no macro yet so I can't upload it.

There is a pivot table. When you double clicking on the “Grand_Total and “Grand_Total” cell in a pivot table a new sheet is created containing the data from the pivot table.

Part of my question is how to handle the issue of every day the pivot table creates a sheet of data it uses a different name.

Perhaps you can create a pivot table to see what I am talking about.
Reply With Quote
  #4  
Old 02-28-2017, 07:19 AM
NoSparks NoSparks is offline Need Help Macro That Uses Pivot Table to Create New Sheet Windows 7 64bit Need Help Macro That Uses Pivot Table to Create New Sheet Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 831
NoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really nice
Default

Hello Bob,

I would suspect if you right click the tab of the sheet containing the “Grand_Total and “Grand_Total” cell that you double click,
then click View Code,
the sheet module that opens would contain a
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) event procedure.
If so, you should post it so we have something to work with.

Quote:
I am trying to write a macro to automate a process that happens every day.
Sounds like the perfect opportunity to use Excels' built in macro recorder to record the daily process.
Posting this would also be of great help towards getting assistance.
Reply With Quote
  #5  
Old 02-28-2017, 07:44 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Need Help Macro That Uses Pivot Table to Create New Sheet Windows 7 64bit Need Help Macro That Uses Pivot Table to Create New Sheet Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,780
Pecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant future
Default

So you are creating a new pivot table each day based on new daily data and the old data is erased?
You only use a Pivot Table for one day?
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
  #6  
Old 02-28-2017, 08:15 AM
Bob123456789 Bob123456789 is offline Need Help Macro That Uses Pivot Table to Create New Sheet Windows 7 64bit Need Help Macro That Uses Pivot Table to Create New Sheet Office 2010 32bit
Novice
Need Help Macro That Uses Pivot Table to Create New Sheet
 
Join Date: Feb 2017
Posts: 10
Bob123456789 is on a distinguished road
Default

NoSparks.

Using the macro recorder is what I started doing. The problem is every time I double click on the “Grand_Total and “Grand_Total” cell When it creates the new sheet it gives it a different name. The next steps in the macro need to get the data from this newly created sheet. Tough to repeat when it is always a different name!

When I click on the sheet with the pivot table in it, right click and select view code there is no code there.

Pecoflyer

The pivot table normally doesn't change, only on rare occasions. The data in it every day does change.
Reply With Quote
  #7  
Old 03-14-2017, 07:57 AM
Bob123456789 Bob123456789 is offline Need Help Macro That Uses Pivot Table to Create New Sheet Windows 7 64bit Need Help Macro That Uses Pivot Table to Create New Sheet Office 2010 32bit
Novice
Need Help Macro That Uses Pivot Table to Create New Sheet
 
Join Date: Feb 2017
Posts: 10
Bob123456789 is on a distinguished road
Default

Can anyone help with this?
Reply With Quote
  #8  
Old 03-14-2017, 10:05 AM
NoSparks NoSparks is offline Need Help Macro That Uses Pivot Table to Create New Sheet Windows 7 64bit Need Help Macro That Uses Pivot Table to Create New Sheet Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 831
NoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really nice
Default

Quote:
Can anyone help with this?
You've supplied neither a sample Excel file nor any attempt at a macro.
What type of help are you expecting ?
Reply With Quote
  #9  
Old 03-14-2017, 10:30 AM
Bob123456789 Bob123456789 is offline Need Help Macro That Uses Pivot Table to Create New Sheet Windows 7 64bit Need Help Macro That Uses Pivot Table to Create New Sheet Office 2010 32bit
Novice
Need Help Macro That Uses Pivot Table to Create New Sheet
 
Join Date: Feb 2017
Posts: 10
Bob123456789 is on a distinguished road
Default

I can't upload it as it is a work file.

"There is a pivot table. When you double clicking on the “Grand_Total and “Grand_Total” cell in a pivot table a new sheet is created containing the data from the pivot table.

Part of my question is how to handle the issue of every day the pivot table creates a sheet of data it uses a different name.

Perhaps you can create a pivot table to see what I am talking about."
Reply With Quote
  #10  
Old 03-14-2017, 12:02 PM
NoSparks NoSparks is offline Need Help Macro That Uses Pivot Table to Create New Sheet Windows 7 64bit Need Help Macro That Uses Pivot Table to Create New Sheet Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 831
NoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really nice
Default

I guess it's your choice of whether or not to supply anything to work with.

I wish you luck with your project.
Reply With Quote
  #11  
Old 03-14-2017, 12:07 PM
Bob123456789 Bob123456789 is offline Need Help Macro That Uses Pivot Table to Create New Sheet Windows 7 64bit Need Help Macro That Uses Pivot Table to Create New Sheet Office 2010 32bit
Novice
Need Help Macro That Uses Pivot Table to Create New Sheet
 
Join Date: Feb 2017
Posts: 10
Bob123456789 is on a distinguished road
Default

You can exactly create the same circumstance by creating a pivot table. When you double click on the Grand Total/Grand Total intersection cell it creates a new sheet. When you do it again, it creates a new sheet with a different name.

I want to create a macro that does all of this automatically. It is difficult when the name of the new sheet changes every time.
Reply With Quote
  #12  
Old 03-14-2017, 12:59 PM
NoSparks NoSparks is offline Need Help Macro That Uses Pivot Table to Create New Sheet Windows 7 64bit Need Help Macro That Uses Pivot Table to Create New Sheet Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 831
NoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really nice
Default

Post the macro that creates the new sheet.
Reply With Quote
  #13  
Old 03-14-2017, 01:02 PM
Bob123456789 Bob123456789 is offline Need Help Macro That Uses Pivot Table to Create New Sheet Windows 7 64bit Need Help Macro That Uses Pivot Table to Create New Sheet Office 2010 32bit
Novice
Need Help Macro That Uses Pivot Table to Create New Sheet
 
Join Date: Feb 2017
Posts: 10
Bob123456789 is on a distinguished road
Default

1 There is no macro yet

2 It is a work product and I can't post it.

3 You can manually create the issue I am describing by following the steps I have outlined for you several times.
Reply With Quote
  #14  
Old 03-14-2017, 01:25 PM
NoSparks NoSparks is offline Need Help Macro That Uses Pivot Table to Create New Sheet Windows 7 64bit Need Help Macro That Uses Pivot Table to Create New Sheet Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 831
NoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really nice
Default

Good luck with your project.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help Macro That Uses Pivot Table to Create New Sheet How do I create a report that works like a pivot table but does not calculate values elizbeth6339 Excel 1 03-09-2016 07:14 AM
extract specific pivot table data to a new sheet theexpat Excel Programming 0 02-18-2016 10:08 AM
Need Help Macro That Uses Pivot Table to Create New Sheet Create PIVOT chart using few rows in pivot table Santhosh_84 Excel 1 08-31-2015 06:22 AM
How to create a pivot table with text as values ljd108 Excel Programming 0 01-22-2015 07:48 PM
Need Help Macro That Uses Pivot Table to Create New Sheet VBA: Include Dynamic Sheet Name In Pivot Table Source Data ibrahimaa Excel Programming 2 04-28-2012 12:27 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:20 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft