How can deleted data reappear in a refreshed pivot table in Excel

I am using Excel 2003.  I have a worksheet full of data and built a pivot 
table on another sheet (within the existing datasheet).  Nothing too 
complicated.  

I updated my data by pasting new data over the top of the old data and 
updated my pivot table.  

The problem is that in the pivot table one of the fields still allows me to 
select on data that no longer exists in the data.  More specifically, I have 
a column in the base data entitled "Vendors" and have approximately 20 
different vendors that appear throughout the data.  When I update my pivot 
table, in the vendor selection list I have the current 20 vendors....fine.  
However, I also have approximately 5 other vendors that were listed in old 
data that are not in the current data.

How do I prevent the old data from appearing in the updated pivot table?     
0
2/23/2005 3:01:02 PM
excel.misc 78881 articles. 5 followers. Follow

3 Replies
1038 Views

Similar Articles

[PageSpeed] 46

http://www.contextures.com/xlPivot04.html



-- 

Regards,

Peo Sjoblom



"excel_user123456" <excel_user123456@discussions.microsoft.com> wrote in
message news:B9AFE456-1860-49A1-8E35-3DA87F0B686A@microsoft.com...
> I am using Excel 2003.  I have a worksheet full of data and built a pivot
> table on another sheet (within the existing datasheet).  Nothing too
> complicated.
>
> I updated my data by pasting new data over the top of the old data and
> updated my pivot table.
>
> The problem is that in the pivot table one of the fields still allows me
to
> select on data that no longer exists in the data.  More specifically, I
have
> a column in the base data entitled "Vendors" and have approximately 20
> different vendors that appear throughout the data.  When I update my pivot
> table, in the vendor selection list I have the current 20 vendors....fine.
> However, I also have approximately 5 other vendors that were listed in old
> data that are not in the current data.
>
> How do I prevent the old data from appearing in the updated pivot table?


0
terre081 (3244)
2/23/2005 3:22:47 PM
I tried the solution you provided on the site...it didn't work.  The 
information directly addressed the problem...that is what I'm trying to 
fix.....it just didn't fix it.  I didn't try the visual basic solution as I 
am not familier with VB.  Any other suggestions?  

"Peo Sjoblom" wrote:

> http://www.contextures.com/xlPivot04.html
> 
> 
> 
> -- 
> 
> Regards,
> 
> Peo Sjoblom
> 
> 
> 
> "excel_user123456" <excel_user123456@discussions.microsoft.com> wrote in
> message news:B9AFE456-1860-49A1-8E35-3DA87F0B686A@microsoft.com...
> > I am using Excel 2003.  I have a worksheet full of data and built a pivot
> > table on another sheet (within the existing datasheet).  Nothing too
> > complicated.
> >
> > I updated my data by pasting new data over the top of the old data and
> > updated my pivot table.
> >
> > The problem is that in the pivot table one of the fields still allows me
> to
> > select on data that no longer exists in the data.  More specifically, I
> have
> > a column in the base data entitled "Vendors" and have approximately 20
> > different vendors that appear throughout the data.  When I update my pivot
> > table, in the vendor selection list I have the current 20 vendors....fine.
> > However, I also have approximately 5 other vendors that were listed in old
> > data that are not in the current data.
> >
> > How do I prevent the old data from appearing in the updated pivot table?
> 
> 
> 
0
2/23/2005 7:45:02 PM
Debra's code is very easy to use.  The following is a step by step guide
that will show you what you need to do:-

Hit ALT+F11 and this will open the VBE (Visual Basic Editor)
Top left you will hopefully see an explorer style pane.  Within this pane
you need to search for
your workbook's name, and when you find it you may need to click on the + to
expand it.  Within
that you should see the following:-

VBAProject(Your_Filename)
   Microsoft Excel Objects
        Sheet1(Sheet1)
        Sheet2(Sheet2)
        Sheet3(Sheet3)
        ThisWorkbook

If you have named your sheets then those names will appear in the brackets
above as opposed to what you see at the moment in my note.

Right click on the where it says VBAProject(Your_Filename) and choose
'Insert Module' and it will now look like this

VBAProject(Your_Filename)
   Microsoft Excel Objects
        Sheet1(Sheet1)
        Sheet2(Sheet2)
        Sheet3(Sheet3)
        ThisWorkbook
   Modules
        Module1

Double click the Module1 bit and then paste in the following
code starting at the Sub DeleteOldItemsWB() bit and finishing at the End Sub
bit.

Sub DeleteOldItemsWB()
'gets rid of unused items in PivotTable
' based on MSKB (202232)
Dim ws As Worksheet
Dim pt As PivotTable
Dim pf As PivotField
Dim pi As PivotItem

On Error Resume Next
For Each ws In ActiveWorkbook.Worksheets
  For Each pt In ws.PivotTables
    pt.RefreshTable
    For Each pf In pt.VisibleFields
      If pf.Name <> "Data" Then
        For Each pi In pf.PivotItems
          If pi.RecordCount = 0 And _
            Not pi.IsCalculated Then
            pi.Delete
          End If
        Next
      End If
    Next
  Next
Next

End Sub

Then hit File / Close and return to Microsoft Excel and save the file.  Now
to run it, just do Tools / Macro / Macros / DeleteOldItemsWB


If you then want to get rid of the macro, then do the following:-

Hit ALT+F11 and this will open the VBE (Visual Basic Editor)
Top left you will hopefully see an explorer style pane.  Within this pane
you need to search for
your workbook's name, and when you find it you may need to click on the + to
expand it.  Within
that you should see the following:-

VBAProject(Your_Filename)
   Microsoft Excel Objects
        Sheet1(Sheet1)
        Sheet2(Sheet2)
        Sheet3(Sheet3)
        etc..........................
        ThisWorkbook
   Modules
        Module1

Right click on the Module1 and select remove.  When prompted with a question
re exporting, just hit no.  Then hit File / Close and return to Microsoft
Excel and save the
file.

-- 
Regards
           Ken.......................    Microsoft MVP - Excel
              Sys Spec - Win XP Pro /  XL 97/00/02/03

----------------------------------------------------------------------------
                  It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------

<snip>


0
ken.wright (2489)
2/23/2005 8:34:12 PM
Reply:

Similar Artilces:

Using Relative path for XML data file?
Is there a way to specify a relative path to an XML data file imported into Excel 2003? I am writing a web app that generates report data as XML for the user to download to their local machine. This data is to be consumed by an Excel reporting spreadsheet, which contains display-formatted tables and charts that are mapped to various data fields in an XML Map, which is in turn linked to the xml data file they will download. The idea is the user only needs to download the data for updates, not the whole spreadsheet. However, since I cannot predict the path where the user will store their...

Changing Cells and entering data in them
Thanks for the help again. Big thanks to Steve you've got me this far. I went out and bought a book, but it's like reading a foreign language. I was informed today that I can't have message boxes come up. I need to have the code point at the cells and if they are blank turn which ever one is blank red or if both are then both turn red then pause for each cell to be filled in. Cell F14 "Last Name" then automatically go to Cell F16 "First Name" on tab or enter. Basically if Cell F22 or F23 has an X in it, Cells F14 an F16 turn red and cell F14 has the focus...

Excel button problem
Hi All I have a macro that copies a worksheet in the active workbook and puts it into a new workbook - then formats it and deletes any buttons on the worksheet. On the first click on the button the macro works ok. On the second click, it fails because the all assigned macros on all buttons in the active workbook changed from "mba" to "book1!mba". Book 1 doesn't exists (wasn't opened, wasn't saved, doesn't have the macros). I've never experienced this problem before?? Can anyone help to solve this problem? FYI The macro to do this is c...

Excel 97 #9
Please can anyone help??? I have two columns in Excel 97. The first contains a list of statu values eg. pending, or granted or withdrawn. The second contains date eg.01/12/1997, 05/06/2003. I woudl like to know how to get all th granted apps before 31/12/2003. Can anyone help please -- Message posted from http://www.ExcelForum.com theres many ways, but an easiest way would be to do a sort. Highlight the 2 columns, click on data, then sort, then sort by status, then by date. this should group them all together. hope this helps...toe >-----Original Message----- >Please can anyo...

Unable to delete empty database
I recently moved a group of users out of one database into another Database within the same storage group. After successfully moving all users (except SMTP and SystemMailbox) out of the 1st database I attempted to delete the database only to receive an error: One or more users currently use this mailbox store. These users must be moved to a different mailbox store or be mail disabled before deleting this store. Id no: c1034a7f Exchange System Manager Can I delete this mailbox via ADSIEDIT? Is this the recommended alternative? Thanks, BJ Use the AD Users and Computers snap-in ...

New to excel
Hi All, I'm new to Excel ( and to this forum :) ) and so I hope somebody may b able to help me. I've got 2 questions.... QUESTION 1 I've got a spreadsheet which takes data from one worksheet and uses i to calculate data in a second worksheet using the following code formula: =IF('4th November 2005'!B19="","nothing here dude",IF(B19<'4th Novembe 2005'!B19,"UP",IF(B19='4th November 2005'!B19,"Same",IF(B19>'4t November 2005'!B19,"DOWN")))) The problem is, when I create a new worksheet I have...

Looking for Excel Help
I'm a very novice Excel user and am looking for a little help with creating a formula for a spreadsheet I'm creating for my personal use. I would appreciate some assistance if possible. Thanks in advance. Dan --- Message posted from http://www.ExcelForum.com/ Hi Dan! Post a sample of what you want to do. Your question is just a tad open ended <g> -- Regards Norman Harker MVP (Excel) Sydney, Australia njharker@optusnet.com.au Excel and Word Function Lists (Classifications, Syntax and Arguments) available free to good homes. "DanB4105" <DanB4105.ywtpa@excelfor...

Pivot Table Question #5
How do I make the row headers show up in front of each row on pivot table instead of just once on the first row of a section? Thanks Try this: Copy the pivot table Do a Paste Special > Values into another sheet Ensure that the top left cell is A1 Run the Sub FillBlanks() below (from MVP Debra D) Sub FillBlanks() 'by Debra Dalgleish 7-Dec-2001 'fill blanks cells with data from above Range("A1").CurrentRegion _ .SpecialCells(xlCellTypeBlanks) _ .FormulaR1C1 = "=R[-1]C" Range("A1").CurrentRegion.Copy Range("A1").PasteS...

How to delete a set of rows depending on Value
I have two worksheets Worksheet A 27 Columns 1600 Rows. Worksheet B 1 Column 200 Rows I need Worksheet A to look at each cell in Worksheet B, if a cell exists in Worksheet A, then I need the row deleted... Basically I have a list of Grand list of items to do, then a list of items already completed. I need to now remove all entries in the grand list that have been completed. Is this feasible or should I look at using some Unix script. It sounds like you could use VLOOKUP to find out if the value in B exists on A: http://www.officearticles.com/excel/vlookup_formulas_in_microsoft_excel....

Excel corrupts when asking to update vlookups
We are experiencing weird behavior with some Office 2K3 Excel spreadsheets that contain lots of calculations, but no macros. On some pc’s Excel acts normally, on others you get the error. I have a couple of screen shots available. Any help is appreciated. If desired, send your file to my address below. I will only look if: 1. You send a copy of this message on an inserted sheet 2. You give me the newsgroup and the subject line 3. You send a clear explanation of what you want 4. You send before/after examples and expected results. -- Don Gu...

Uninstall of mappoint has caused errors with excel
Hi, I am running Office 2003 on the terminal server (windows 2003) and had a copy of mappoint as well. This is a mapping program. We ininstalled mappoint which has caused an error message with Excel and other office products. The error says "Cd:\documents and settings\administrator.ocrdc1\application data\microsoft\addins c:\Program files\common files\microsoft shared\geography\mpoai9.dll is not a valid add-in." I then click OK and excel opens up and everything is fine. The problem is that we are using other programs as well such as Quickbooks that export to excel and t...

Is anyone an expert with outlook that I can call on the phone?
How do I share calenders between outlook and my MSN Premier account? Assuming you are using the outlook connector, you need to set the msn account to be the default message store then outlook will use the msn calendar as the default. -- Diane Poremsky [MVP - Outlook] Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com Outlook Tips by email: mailto:dailytips-subscribe-request@lists.outlooktips.net EMO - a weekly newsletter about Outlook and Exchange: mailto:EMO-NEWSLETTER-SUBSCRIBE-REQUEST@PEACH.EASE.LSOFT.COM You can access this...

data sort
ok now should be simple >> I need to sort by month on data that is held in format >> day/month so eg 1511 1510 3011 3010 now custom/ends with/ 11... does not work custom/ends with/ ??11.. or *11 does not work either contains 11 does not work (& would also be wrong if data set contained 1011) but still I am stumped so any help would be great cheers Alex I would be inclined to add a new, temporary field of formulas that pull off the right 2 digits, and sort by that: =RIGHT(A1,2) -- Jim Rech Excel MVP ...

Pulling data from separate tabs
When charting in Excel 2002 is there a way to use sets of data from two different tabs within the same worksheet? For example, a spreadsheet contains separate tabs for prior year and current year data. Is there a way to reference the data or label series to pick up data from both? I tried pointing and clicking, and then typing the following as a reference for the axis labels: ='Prior Year'!$B$110:$M$110,'Current Year'!'$B$110:$M$110 but receive an error that I'm referring to an external worksheet. I've used the comma (') in the past to reference breaks ...

How do I Remove a Split from my Comments in Excel 2003? #2
I have set my current workbook to split/freeze the first column and first 2 rows. Now, when I add a comment to the second row (in any column) my comments are cut off if I should scroll down. I don't ever remember the behavior before. And I don't know what I've done to enable it but it's really annoying. How do turn this off ? ...

learning Excel #3
Hi, I was considering learning Excel as an additional tool for my data analysis work. Is it better to use data sets that I have previously used with SPSS and apply the same analysis tools as in SPSS? For applying the appropriate tools, I was considering using excel's online help. The second option I have is to use some excel book for data analysis and apply the techniques to data sets provided with the book. Any suggestions????? regards Metal ...

unable to paste Excel 2003 chart into Outlook 2003
(This was posted on "excel.charting" group.) I have a user who's unable to paste an Excel 2003 chart into Outlook 2003 email message. In Outlook options, the checkbox is selected for "Use Microsoft Office Word 2003 to edit e-mail messages". When I tested this on my own computer running the same version of Office, if the box is check, I have no problem pasting; if this box is cleared, I cannot paste. But on his computer, it doesn't work regardless. Thanks and regards, TL ...

Can't do adjustment in analytical accounting
I am trying to change an analytical assignmnet through the Edit Analysis. When I try and change it, I receive an error stating "The Code of this Transaction Dimension cannot be adjusted". Has anyone seen this before? I have done similar changes many times, but I don't know why I can't now. Any insight would be helpful. Thanks, KJ Hi KJ What version of Gp are you running? I haveseen this happen in 8 but one of the service packs fixed it. (I think it was SP 4 or 5) Fliehigh "KJ" wrote: > I am trying to change an analytical assignmnet through the Edit >...

Can I share entities in migration process?
The entities in CRM have only one owning user. If I want=20 who a user see a entity of another user, the entity must=20 be shared with this user.=20 Well, I want migrate entities who must be shared with some=20 users. Exists a way to do it? Thank you for pay attention and sorry my bad english. []'s Vin=EDcius Pitta Lima de Ara=FAjo ...

Formula for cross tab data filling
Hi All Excel 2003 How to using formula for data filling as below (Y/N) ? Sheet A Product A Product B Product C System A Y N Y System B Y Y N Sheet B System A Product A System A Product C System B Product A System B Product B moonhkt ...

Help with importing data
Can I have users fill in a form in Access and have that data be transferred and updated to a spreadsheet. Need for fill out several fields and then export to a specific spreadsheet and place that data into the cells that will update that cell (add to the total in that cell) of a spreadsheet. ...

A message that cannot be deleted, opend or moved
THere is a message in a user's inbox that cannot be opened, deleted or moved. How can I delete that message ? Amila Amila Chandrasekera <amilanc@spss.com> wrote: > THere is a message in a user's inbox that cannot be opened, deleted or > moved. How can I delete that message ? One drastic way is to create a new PST file and copy everything from the old file to the new, with the exception of the misbehaving message. Then remove the old file. did you try shift-delete? -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote ...

Cannot Delete Any Records
We're running CRM 3 Rollup v3 and we have recently found that we cannot delete any records in CRM. We recently migrated over to a Windows 2003 Enterprise install running SQL 2000 Enterprise. Everything else is working without issue for us. For example I am a Sys Admin, and I receive a generic SQL Server error when going to delete an activity? I know that in the past this was possible, any thoughts? Sean; sounds like something went wrong with your migration. you can run a CRM trace or a SQL Profiler trace while performing the deletion to see if you can pin-point the error. Dave Ire...

Nothing happens at ctrl-alt-delete prompt
I have a desktop running WinXP Pro. It was running terribly slow, so I rebooted. When I got to the ctrl-alt-delete prompt, I hit the keys and nothing happened. I powered off and back on again and same thing. I rebooted to Last Known Good Configuration, and still the same thing. Then I tried a different keyboard. Still nothing happens when you press ctrl-atl-delete. During the boot process, the lights on the keyboard (num lock, cap lock, etc) blink, so it appears that the keyboard and computer are communicating on some level, at least. Anyone have any thoughts on anything ...

Excel VBA
When you select the autofilter, the drop down list is created from the unique data in that column. Is there any way to customize this list, so the changes are permanent? For instance, I might have in one(1) column the following 4 row entries: red, blue, green (all are single cell entries) red, blue red blue, green I want my autofilter drop down list to read: red instead of red, blue, green blue red, blue green red blue, green (like normal) If I chose red from the drop down list...