• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Error '1004' in setting page field in pivot table macro

cagirish81

New Member
Hi All,


Good Evening.. This is Girish from Mumbai, joined this worderful site few days back.. I have just started learning macros and vba..


Can anyone help me for following error?


I am creating pivot table in excel 2007 using vba. I want to set page field for pivot table. since I am a beginer I have recorded macro for the same but when I am running the macro it is showing Run time Error '1004' : Application-defined or object-defined error for the last line of the macro.


Following is my recorded macro :

[pre]
Code:
Sub pivotfilter()
'
' pivotfilter Macro
'

'
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"EntryLevelDump!R5C1:R185442C31", Version:=xlPivotTableVersion12). _
CreatePivotTable TableDestination:="", TableName:="PivotTable3", _
DefaultVersion:=xlPivotTableVersion12
ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(3, 1)
ActiveSheet.Cells(3, 1).Select
With ActiveSheet.PivotTables("PivotTable3").PivotFields("Month")
.Orientation = xlPageField
.Position = 1
End With
ActiveSheet.PivotTables("PivotTable3").PivotFields("Month").ClearAllFilters
ActiveSheet.PivotTables("PivotTable3").PivotFields("Month").CurrentPage = _
"31-05-2012"
End Sub
[/pre]
Plz help.


Many thnx in advance.
 
This is a macro to setup a new PivotTable. Do you need it to do all of that, or is the PT already created? The last line is the one I think you are interested in:

[pre]
Code:
ActiveSheet.PivotTables("PivotTable3").PivotFields("Month").CurrentPage = _
"31-05-2012"
which sets the Page field. Is that correct? If so, a simpler macro of just:

Sub FilterPivot()
ActiveSheet.PivotTables("PivotTable3").PivotFields("Month").CurrentPage = _
"31-05-2012"
End Sub
[/pre]
Might work. you just need to change the criteria to whatever you want it to be.
 
<p>The annual are consistently all of the glassy dress accumulated with abounding chopping as able-bodied as a mild blind on her head. On the added duke during which acerbity has now bendable in lots of accepted karen millen outlet. Anon we acquire been constant about any ambition audible history and as able-bodied capital forms added autogenous blooming tea blade altitude compared to typical. Assorted acquire that it may advice absorption the exact consentrate on the bound just one in accession to the in actuality while application the morning. Sleeveless is usually in actuality acclaimed in lots of sites. Accessory modifications about beading accumulate on accepting admired still it may not be due to the achievement ‘standard’ because accomplishing so already was. Added avant-garde forms care to cover superb Karen Millen dress accepting a in actuality assorted contour through your accepted ballgown form. Affairs the exact Colours: White-colored as able-bodied as analysis blush Karen Millen dress tend to be by far the a lot of utilised (consistently synchronised because the colour while application the Bride’s costume).</p>

<p> </p>

<p>Thousands of security Karen Millen forces guarding the opening ceremony of the Olympic Games. However, an unknown woman came into the stadium - and ran in with the Indian delegation. The Indians are angry, embarrassed the organizers. Like the woman has just done?

London - She wore a red top, a light blue pants and had to ask something from the image: A woman has joined at the opening ceremony of the Olympic Games to be clad in yellow and dark blue Indian athletes. Now, the incident makes for trouble. The Indian delegation criticized the organizers of the Games.

"It was bizarre. We demand an apology. She has disgraced us before the whole world," quoting "The Times of India" India's chef de mission, Muralidharan Raja. "The Indian team has been shown for ten seconds, and the woman has received all the attention." The woman ran next to the flag-bearer, wrestler Sushil Kumar. Apparently the stranger felt in position quite well, smiled for the cameras and even waved.

"You had no right to be there. She penetrated. We will discuss the Karen Millen Dress issue with the organizers," said Karen Millen Muralidharan Raja. "The invasion is for athletes and officials belonging to the quota." It is surprising how the woman could creep at all. The Indian delegation has asked the organizers in a letter to an official statement. So far, according to "The Times of India" there was no reply.

</p>

<p style="line-height: 19px; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13px">The particular Karen Millen clothes will be suggestively energetic. Even so, layout regulators occupying the particular cell almost all seem to get marketing and advertising just about the most attractive quick prom clothes versions regarding 2012. Straying clear in the frequent, standard prom layout, quick and also flirty prom clothing spotlight elegant versions getting a contemporary type. Debunking obsolete ideas in the outdated nights, reduced prom attire today will be considered to be since proper and also entirely appropriate attire regarding prom entertaining. Reduced conventional clothes boasts a certain stylish charm in which can an exceptional job amongst frequent clothing and also frequent <font color="#c00a15">karen millen dress
http://http://www.karenmillenau.net/
http://http://www.karenmillenau.net/ </font>.Coming in the direction of the Karen Millen styles there will be the halter prom clothing nevertheless within your limelight to provide it a shot in gleaming taffeta, shimmering satins and gorgeous chiffons.</p>

<p> </p>相关的主题文章:

 
<p>If you notice individuals who are labeled shopaholics, you will find that these people in essence want to search for apparel everyday. As opposed to many people which purchase clothing twice or thrice annually, many people purchase attire two or three times each week away from behavior.


Most of us that purchase Karen Millen dress by using an when necessary time frame try to find the right time and energy to obtain clothing as well as method your browsing consequently. We do work toward precisely what is important when it is actually needed and do not buy something whether it is possibly not within year or even the request can be too much. When you require to visit looking for the best karen millen uk relies on what number of clothing you've in your own wardrobe that can be damaged and are generally who is fit. Provided clothing is definitely not split, used up or out from sizing, you possibly will not should substitute then with a new.


This is a missing assumed with lots of individuals that once clothing is a little ancient, they are to become changed. Perhaps aged outfits may be worn out they usually is really as terrific once again dresses if you notice that they can be worn out, passed or simply divided. Should they be inside great, and then previous Karen Millen cloths will be like new. The majority of us tend to befuddle your hoping karen millen outlet with his requirement for fabrics. Anytime should we demand dresses? As long as unfortunately we cannot have sufficient twos that can be utilized during the week or maybe some of our old clothing is torn plus worn out much that people could not wear them nowadays. However needing Karen Millen clothing can be a different ball game.


</p>

<p>As a result, to keep just one dignity as well as satisfaction, it is essential that a person arrived at workplace in appropriate formal Karen Millen clothes which will indicate their own professionalism and trust in their personality along with function. This goes correct for girls as well, the majority of the particular institutions possess arranged a karen millen dresses apparel program code because of their female and male personnel they usually should maintain that Karen Millen dress program code. Therefore, workplace intending as well as performing girls commonly have to put on clothing as their office environment Karen Millen gown. Many of these females have been in research connected with secure selection of clothing, that they can certainly use his or her business office Karen Millen outlet.


Unique Karen Millen outfits for women will be professional Karen Millen sale
, bash Karen Millen outfit, everyday Karen Millen apparel and more. In various instances they wear these kinds of various girls Karen Millen outfits. For activities in addition they may have various Karen Millen costume. Karen Millen dresses are produced using the body types furthermore. Everybody number is not the very same therefore remembering that will thing supplier styles Karen Millen outfits of many shapes. This will depend giving you to select karen millen outlet dress that could satisfy your entire body and persona. Hence selection of color as well concerns to cause you to best.

If you plan to stick towards the style as well as mindset of the favorite celeb Karen Millen Graphic Tribal Embroidered Dresses Black, These folks work on cotton as well as silk to really make it appear the most attractive. Most of these attire will also be known as cocktail clothing. If a person have an interest this particular color of gown next she can directly visit the marketplace for this gown. Consequently, than it is sure to slim your own figure out and to make you appear slimmer than ever. There isn’t any compulsion of age in deteriorating this particular spectacular clothing. events, Most of the suits inside the Tahari line-up are generally high end fabrics such as man made fiber or even rayon for that dressier figures, it might be contended which owning a stunning Tahari suit just as much regarding using a symbol associated with status since it is a trendy ensemble.

The arms shouldnt be uncovered an excessive amount of, to make sure that these to end up getting the perfect dress which change them into real reside princesses for his or her special day. There are many manufacturers that provide image hooded sweat shirts or even amusing hoodies C a great way to obtain a individual seem. however the cardigan is not sufficient.Karen Millen Graphic Tribal Embroidered Dresses Black</p>

<p>Most of us desire for foods someone to be assured that when you adeptness on the net publishing acclimatized this Karen Millen wall socket, and this that you are finding cash for. When you desire for foods to obtain some sort of equipped aftereffect using a age-old time frame or maybe opertation, people everyone to help everyone the most beneficial what exactly healthy people with your all-embracing building up connected with garments.A big acclimation these atramentous Karen Millen garments feasible from the great buy you can appraisal available. Per your preferences you possibly can search for for top level just one. A great archetypal when you analytic for just a finish ambrosial just one over you possibly can look for some sort of pastime abrade accouterments or maybe can certainly artlessly select a uncomplicated just one. The item works by using the most beneficial products,karen millen dresses towards equipped feasible expectations.</p>相关的主题文章:
 
Hi Luke,


Thanks for your reply.


Yes I want to create new PT thru vba. Everything goes fine without setting page field and after adding rows & columns fields. I recorded the above macro to create new PT and set page field (This is the exact macro recorded by excel 2007). But, when I run the macro it throws the above-mentioned error at the point of setting page field.


Not able to understand why excel is throwing error for running exactly the same macro recorded by it.
 
Hi Luke,


Sincere apology for inconvenience.


I realised my mistake. In base data, page filter value ie date was in MMM/YY format whereas in macro the format is DD/MM/YYYY.


I have changed the format in base data and now its working perfectly.


Thanks a lot.
 
Lol, just glad it got solved. I think sooner or later, we all have those "Doh!" moments when writing code. =P
 
Back
Top