PIVOT - Using a cell outside the table for change the grouping

Hi experts,

I want to enable users with few knowledge of pivot techniques to
change the grouping of a pivot chart resp. the underlying pivot table.
The idea is, to have a changeable cell value beneath the chart to
enter the group (groups of 2, 4, 6, 5, etc...). The associated pivot
table shall change it's groupings accordingly, thus forces to change
the associated chart.

Any idea, how to achieve this?
Thanks and have a nice day
Michael
0
emte69 (54)
2/13/2009 7:59:36 PM
excel 39879 articles. 2 followers. Follow

11 Replies
777 Views

Similar Articles

[PageSpeed] 13

Hi,

What kind of groupings are we talking about when we say 2, 4, 6, 5?

What is being grouped and how?  What fields, row fields, more than one row 
field, column fields, both row and column fields?  Are these fields groups on 
Month, Day (if so how many), Year, Hour, Minute, Second, Numbers?  Or are 
these manual groupings?  Are these groupings those generated by the Grouping 
command or by anding other row or column fields, or by checking and 
unchecking filter options?


-- 
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"Michael.Tarnowski" wrote:

> Hi experts,
> 
> I want to enable users with few knowledge of pivot techniques to
> change the grouping of a pivot chart resp. the underlying pivot table.
> The idea is, to have a changeable cell value beneath the chart to
> enter the group (groups of 2, 4, 6, 5, etc...). The associated pivot
> table shall change it's groupings accordingly, thus forces to change
> the associated chart.
> 
> Any idea, how to achieve this?
> Thanks and have a nice day
> Michael
> 
0
2/13/2009 9:24:18 PM
On Feb 13, 10:24 pm, Shane Devenshire
<ShaneDevensh...@discussions.microsoft.com> wrote:
> Hi,
>
> What kind of groupings are we talking about when we say 2, 4, 6, 5?
>
> What is being grouped and how?  What fields, row fields, more than one row
> field, column fields, both row and column fields?  Are these fields groups on
> Month, Day (if so how many), Year, Hour, Minute, Second, Numbers?  Or are
> these manual groupings?  Are these groupings those generated by the Grouping
> command or by anding other row or column fields, or by checking and
> unchecking filter options?
>
> --
> If this helps, please click the Yes button
>
> Cheers,
> Shane Devenshire
>
> "Michael.Tarnowski" wrote:
> > Hi experts,
>
> > I want to enable users with few knowledge of pivot techniques to
> > change the grouping of a pivot chart resp. the underlying pivot table.
> > The idea is, to have a changeable cell value beneath the chart to
> > enter the group (groups of 2, 4, 6, 5, etc...). The associated pivot
> > table shall change it's groupings accordingly, thus forces to change
> > the associated chart.
>
> > Any idea, how to achieve this?
> > Thanks and have a nice day
> > Michael

Hi Shane,
thanks for your answer.
It is a manually grouping. Here is a picture:
http://michaeltarnowski.de/temp/Clipboard02.gif

Michael
0
emte69 (54)
2/14/2009 3:51:49 PM
On Feb 13, 10:24 pm, Shane Devenshire
<ShaneDevensh...@discussions.microsoft.com> wrote:
> Hi,
>
> What kind of groupings are we talking about when we say 2, 4, 6, 5?
>
> What is being grouped and how?  What fields, row fields, more than one row
> field, column fields, both row and column fields?  Are these fields groups on
> Month, Day (if so how many), Year, Hour, Minute, Second, Numbers?  Or are
> these manual groupings?  Are these groupings those generated by the Grouping
> command or by anding other row or column fields, or by checking and
> unchecking filter options?
>
> --
> If this helps, please click the Yes button
>
> Cheers,
> Shane Devenshire
>
> "Michael.Tarnowski" wrote:
> > Hi experts,
>
> > I want to enable users with few knowledge of pivot techniques to
> > change the grouping of a pivot chart resp. the underlying pivot table.
> > The idea is, to have a changeable cell value beneath the chart to
> > enter the group (groups of 2, 4, 6, 5, etc...). The associated pivot
> > table shall change it's groupings accordingly, thus forces to change
> > the associated chart.
>
> > Any idea, how to achieve this?
> > Thanks and have a nice day
> > Michael

Hi Shane,
thanks for your answer.
It is a manually grouping. Here is a picture:
http://michaeltarnowski.de/temp/Clipboard02.gif

Michael
0
emte69 (54)
2/14/2009 3:52:17 PM
Hi,

I see the picture, but I don't see 2, 4, 6, or 5 as option or values 
anywhere in the picture.  So based on the picture, give me an example of what 
you want to have happen.  I see the "before"  what will it look like "after"?

Also, before I go too much further, keep in mind that the pivot table will 
not change just by the user entering a number in a cell.  For that to happen 
you will need to add VBA code.  Second, if the process, whatever it may be, 
turns out to be fairly simple, I think you should teach the users how to do 
it.  One of the problems with programming is that when you leave, if no one 
else is a programmer and something goes wrong - nobody has a clue.

-- 
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"Michael.Tarnowski" wrote:

> On Feb 13, 10:24 pm, Shane Devenshire
> <ShaneDevensh...@discussions.microsoft.com> wrote:
> > Hi,
> >
> > What kind of groupings are we talking about when we say 2, 4, 6, 5?
> >
> > What is being grouped and how?  What fields, row fields, more than one row
> > field, column fields, both row and column fields?  Are these fields groups on
> > Month, Day (if so how many), Year, Hour, Minute, Second, Numbers?  Or are
> > these manual groupings?  Are these groupings those generated by the Grouping
> > command or by anding other row or column fields, or by checking and
> > unchecking filter options?
> >
> > --
> > If this helps, please click the Yes button
> >
> > Cheers,
> > Shane Devenshire
> >
> > "Michael.Tarnowski" wrote:
> > > Hi experts,
> >
> > > I want to enable users with few knowledge of pivot techniques to
> > > change the grouping of a pivot chart resp. the underlying pivot table.
> > > The idea is, to have a changeable cell value beneath the chart to
> > > enter the group (groups of 2, 4, 6, 5, etc...). The associated pivot
> > > table shall change it's groupings accordingly, thus forces to change
> > > the associated chart.
> >
> > > Any idea, how to achieve this?
> > > Thanks and have a nice day
> > > Michael
> 
> Hi Shane,
> thanks for your answer.
> It is a manually grouping. Here is a picture:
> http://michaeltarnowski.de/temp/Clipboard02.gif
> 
> Michael
> 
0
2/15/2009 12:19:01 AM
On Feb 15, 1:19 am, Shane Devenshire
<ShaneDevensh...@discussions.microsoft.com> wrote:
> Hi,
>
> I see the picture, but I don't see 2, 4, 6, or 5 as option or values
> anywhere in the picture.  So based on the picture, give me an example of what
> you want to have happen.  I see the "before"  what will it look like "after"?
>
> Also, before I go too much further, keep in mind that the pivot table will
> not change just by the user entering a number in a cell.  For that to happen
> you will need to add VBA code.  Second, if the process, whatever it may be,
> turns out to be fairly simple, I think you should teach the users how to do
> it.  One of the problems with programming is that when you leave, if no one
> else is a programmer and something goes wrong - nobody has a clue.
>
> --
> If this helps, please click the Yes button
>
> Cheers,
> Shane Devenshire
>
> "Michael.Tarnowski" wrote:
> > On Feb 13, 10:24 pm, Shane Devenshire
> > <ShaneDevensh...@discussions.microsoft.com> wrote:
> > > Hi,
>
> > > What kind of groupings are we talking about when we say 2, 4, 6, 5?
>
> > > What is being grouped and how?  What fields, row fields, more than one row
> > > field, column fields, both row and column fields?  Are these fields groups on
> > > Month, Day (if so how many), Year, Hour, Minute, Second, Numbers?  Or are
> > > these manual groupings?  Are these groupings those generated by the Grouping
> > > command or by anding other row or column fields, or by checking and
> > > unchecking filter options?
>
> > > --
> > > If this helps, please click the Yes button
>
> > > Cheers,
> > > Shane Devenshire
>
> > > "Michael.Tarnowski" wrote:
> > > > Hi experts,
>
> > > > I want to enable users with few knowledge of pivot techniques to
> > > > change the grouping of a pivot chart resp. the underlying pivot table.
> > > > The idea is, to have a changeable cell value beneath the chart to
> > > > enter the group (groups of 2, 4, 6, 5, etc...). The associated pivot
> > > > table shall change it's groupings accordingly, thus forces to change
> > > > the associated chart.
>
> > > > Any idea, how to achieve this?
> > > > Thanks and have a nice day
> > > > Michael
>
> > Hi Shane,
> > thanks for your answer.
> > It is a manually grouping. Here is a picture:
> >http://michaeltarnowski.de/temp/Clipboard02.gif
>
> > Michael

Shane,
the grouping happens in the field "weeks open". As you see, "weeks
open" is currently grouped by 5 (manual click in pivot table, then a
right click, "Group and Show Detail>Group").
I'am looking for a VBA code to change this grouping by changing a cell
value outside the pivot table only  -   thus, no right click in the
table, no more menu selection of "Group and Show Detail>Group", etc.,
-- only entering a value.
Michael
0
emte69 (54)
2/15/2009 2:52:00 AM
-- 
If this helps, please click the Yes button

Cheers,
Shane Devenshire

 
"Michael.Tarnowski" wrote:

> On Feb 15, 1:19 am, Shane Devenshire
> <ShaneDevensh...@discussions.microsoft.com> wrote:
> > Hi,
> >
> > I see the picture, but I don't see 2, 4, 6, or 5 as option or values
> > anywhere in the picture.  So based on the picture, give me an example of what
> > you want to have happen.  I see the "before"  what will it look like "after"?
> >
> > Also, before I go too much further, keep in mind that the pivot table will
> > not change just by the user entering a number in a cell.  For that to happen
> > you will need to add VBA code.  Second, if the process, whatever it may be,
> > turns out to be fairly simple, I think you should teach the users how to do
> > it.  One of the problems with programming is that when you leave, if no one
> > else is a programmer and something goes wrong - nobody has a clue.
> >
> > --
> > If this helps, please click the Yes button
> >
> > Cheers,
> > Shane Devenshire
> >
> > "Michael.Tarnowski" wrote:
> > > On Feb 13, 10:24 pm, Shane Devenshire
> > > <ShaneDevensh...@discussions.microsoft.com> wrote:
> > > > Hi,
> >
> > > > What kind of groupings are we talking about when we say 2, 4, 6, 5?
> >
> > > > What is being grouped and how?  What fields, row fields, more than one row
> > > > field, column fields, both row and column fields?  Are these fields groups on
> > > > Month, Day (if so how many), Year, Hour, Minute, Second, Numbers?  Or are
> > > > these manual groupings?  Are these groupings those generated by the Grouping
> > > > command or by anding other row or column fields, or by checking and
> > > > unchecking filter options?
> >
> > > > --
> > > > If this helps, please click the Yes button
> >
> > > > Cheers,
> > > > Shane Devenshire
> >
> > > > "Michael.Tarnowski" wrote:
> > > > > Hi experts,
> >
> > > > > I want to enable users with few knowledge of pivot techniques to
> > > > > change the grouping of a pivot chart resp. the underlying pivot table.
> > > > > The idea is, to have a changeable cell value beneath the chart to
> > > > > enter the group (groups of 2, 4, 6, 5, etc...). The associated pivot
> > > > > table shall change it's groupings accordingly, thus forces to change
> > > > > the associated chart.
> >
> > > > > Any idea, how to achieve this?
> > > > > Thanks and have a nice day
> > > > > Michael
> >
> > > Hi Shane,
> > > thanks for your answer.
> > > It is a manually grouping. Here is a picture:
> > >http://michaeltarnowski.de/temp/Clipboard02.gif
> >
> > > Michael
> 
> Shane,
> the grouping happens in the field "weeks open". As you see, "weeks
> open" is currently grouped by 5 (manual click in pivot table, then a
> right click, "Group and Show Detail>Group").
> I'am looking for a VBA code to change this grouping by changing a cell
> value outside the pivot table only  -   thus, no right click in the
> table, no more menu selection of "Group and Show Detail>Group", etc.,
> -- only entering a value.
> Michael
> 
0
2/15/2009 4:29:01 AM
On Feb 15, 5:29 am, Shane Devenshire
<ShaneDevensh...@discussions.microsoft.com> wrote:
> --
> If this helps, please click the Yes button
>
> Cheers,
> Shane Devenshire
>
> "Michael.Tarnowski" wrote:
> > On Feb 15, 1:19 am, Shane Devenshire
> > <ShaneDevensh...@discussions.microsoft.com> wrote:
> > > Hi,
>
> > > I see the picture, but I don't see 2, 4, 6, or 5 as option or values
> > > anywhere in the picture.  So based on the picture, give me an example of what
> > > you want to have happen.  I see the "before"  what will it look like "after"?
>
> > > Also, before I go too much further, keep in mind that the pivot table will
> > > not change just by the user entering a number in a cell.  For that to happen
> > > you will need to add VBA code.  Second, if the process, whatever it may be,
> > > turns out to be fairly simple, I think you should teach the users how to do
> > > it.  One of the problems with programming is that when you leave, if no one
> > > else is a programmer and something goes wrong - nobody has a clue.
>
> > > --
> > > If this helps, please click the Yes button
>
> > > Cheers,
> > > Shane Devenshire
>
> > > "Michael.Tarnowski" wrote:
> > > > On Feb 13, 10:24 pm, Shane Devenshire
> > > > <ShaneDevensh...@discussions.microsoft.com> wrote:
> > > > > Hi,
>
> > > > > What kind of groupings are we talking about when we say 2, 4, 6, 5?
>
> > > > > What is being grouped and how?  What fields, row fields, more than one row
> > > > > field, column fields, both row and column fields?  Are these fields groups on
> > > > > Month, Day (if so how many), Year, Hour, Minute, Second, Numbers?  Or are
> > > > > these manual groupings?  Are these groupings those generated by the Grouping
> > > > > command or by anding other row or column fields, or by checking and
> > > > > unchecking filter options?
>
> > > > > --
> > > > > If this helps, please click the Yes button
>
> > > > > Cheers,
> > > > > Shane Devenshire
>
> > > > > "Michael.Tarnowski" wrote:
> > > > > > Hi experts,
>
> > > > > > I want to enable users with few knowledge of pivot techniques to
> > > > > > change the grouping of a pivot chart resp. the underlying pivot table.
> > > > > > The idea is, to have a changeable cell value beneath the chart to
> > > > > > enter the group (groups of 2, 4, 6, 5, etc...). The associated pivot
> > > > > > table shall change it's groupings accordingly, thus forces to change
> > > > > > the associated chart.
>
> > > > > > Any idea, how to achieve this?
> > > > > > Thanks and have a nice day
> > > > > > Michael
>
> > > > Hi Shane,
> > > > thanks for your answer.
> > > > It is a manually grouping. Here is a picture:
> > > >http://michaeltarnowski.de/temp/Clipboard02.gif
>
> > > > Michael
>
> > Shane,
> > the grouping happens in the field "weeks open". As you see, "weeks
> > open" is currently grouped by 5 (manual click in pivot table, then a
> > right click, "Group and Show Detail>Group").
> > I'am looking for a VBA code to change this grouping by changing a cell
> > value outside the pivot table only  -   thus, no right click in the
> > table, no more menu selection of "Group and Show Detail>Group", etc.,
> > -- only entering a value.
> > Michael

Hi community,
I found a solution:

if worksheet A holds the pivot table, and worksheetB the chart and a
cell names "groups" and C13 is a cell in the pivot table.

Sub PivotGrouping()
' set grouping of pvtDelays table
'
    worksheetA.Activate
    Range("C13").Select
    Selection.Group Start:=True, End:=True, By:=worksheetB.Range
("groups").value
    worksheetB.Select
    ActiveSheet.ChartObjects(1).Activate
    ActiveChart.PivotLayout.PivotTable.RefreshTable
End Sub

Cheers Michael
0
emte69 (54)
2/15/2009 1:57:40 PM
On Feb 15, 5:29 am, Shane Devenshire
<ShaneDevensh...@discussions.microsoft.com> wrote:
> --
> If this helps, please click the Yes button
>
> Cheers,
> Shane Devenshire
>
> "Michael.Tarnowski" wrote:
> > On Feb 15, 1:19 am, Shane Devenshire
> > <ShaneDevensh...@discussions.microsoft.com> wrote:
> > > Hi,
>
> > > I see the picture, but I don't see 2, 4, 6, or 5 as option or values
> > > anywhere in the picture.  So based on the picture, give me an example of what
> > > you want to have happen.  I see the "before"  what will it look like "after"?
>
> > > Also, before I go too much further, keep in mind that the pivot table will
> > > not change just by the user entering a number in a cell.  For that to happen
> > > you will need to add VBA code.  Second, if the process, whatever it may be,
> > > turns out to be fairly simple, I think you should teach the users how to do
> > > it.  One of the problems with programming is that when you leave, if no one
> > > else is a programmer and something goes wrong - nobody has a clue.
>
> > > --
> > > If this helps, please click the Yes button
>
> > > Cheers,
> > > Shane Devenshire
>
> > > "Michael.Tarnowski" wrote:
> > > > On Feb 13, 10:24 pm, Shane Devenshire
> > > > <ShaneDevensh...@discussions.microsoft.com> wrote:
> > > > > Hi,
>
> > > > > What kind of groupings are we talking about when we say 2, 4, 6, 5?
>
> > > > > What is being grouped and how?  What fields, row fields, more than one row
> > > > > field, column fields, both row and column fields?  Are these fields groups on
> > > > > Month, Day (if so how many), Year, Hour, Minute, Second, Numbers?  Or are
> > > > > these manual groupings?  Are these groupings those generated by the Grouping
> > > > > command or by anding other row or column fields, or by checking and
> > > > > unchecking filter options?
>
> > > > > --
> > > > > If this helps, please click the Yes button
>
> > > > > Cheers,
> > > > > Shane Devenshire
>
> > > > > "Michael.Tarnowski" wrote:
> > > > > > Hi experts,
>
> > > > > > I want to enable users with few knowledge of pivot techniques to
> > > > > > change the grouping of a pivot chart resp. the underlying pivot table.
> > > > > > The idea is, to have a changeable cell value beneath the chart to
> > > > > > enter the group (groups of 2, 4, 6, 5, etc...). The associated pivot
> > > > > > table shall change it's groupings accordingly, thus forces to change
> > > > > > the associated chart.
>
> > > > > > Any idea, how to achieve this?
> > > > > > Thanks and have a nice day
> > > > > > Michael
>
> > > > Hi Shane,
> > > > thanks for your answer.
> > > > It is a manually grouping. Here is a picture:
> > > >http://michaeltarnowski.de/temp/Clipboard02.gif
>
> > > > Michael
>
> > Shane,
> > the grouping happens in the field "weeks open". As you see, "weeks
> > open" is currently grouped by 5 (manual click in pivot table, then a
> > right click, "Group and Show Detail>Group").
> > I'am looking for a VBA code to change this grouping by changing a cell
> > value outside the pivot table only  -   thus, no right click in the
> > table, no more menu selection of "Group and Show Detail>Group", etc.,
> > -- only entering a value.
> > Michael

Hi community,
I found a solution:

if worksheet A holds the pivot table, and worksheetB the chart and a
cell names "groups" and C13 is a cell in the pivot table.

Sub PivotGrouping()
' set grouping of pvtDelays table
'
    worksheetA.Activate
    Range("C13").Select
    Selection.Group Start:=True, End:=True, By:=worksheetB.Range
("groups").value
    worksheetB.Select
    ActiveSheet.ChartObjects(1).Activate
    ActiveChart.PivotLayout.PivotTable.RefreshTable
End Sub

Cheers Michael
0
emte69 (54)
2/15/2009 1:57:50 PM
On Feb 15, 5:29 am, Shane Devenshire
<ShaneDevensh...@discussions.microsoft.com> wrote:
> --
> If this helps, please click the Yes button
>
> Cheers,
> Shane Devenshire
>
> "Michael.Tarnowski" wrote:
> > On Feb 15, 1:19 am, Shane Devenshire
> > <ShaneDevensh...@discussions.microsoft.com> wrote:
> > > Hi,
>
> > > I see the picture, but I don't see 2, 4, 6, or 5 as option or values
> > > anywhere in the picture.  So based on the picture, give me an example of what
> > > you want to have happen.  I see the "before"  what will it look like "after"?
>
> > > Also, before I go too much further, keep in mind that the pivot table will
> > > not change just by the user entering a number in a cell.  For that to happen
> > > you will need to add VBA code.  Second, if the process, whatever it may be,
> > > turns out to be fairly simple, I think you should teach the users how to do
> > > it.  One of the problems with programming is that when you leave, if no one
> > > else is a programmer and something goes wrong - nobody has a clue.
>
> > > --
> > > If this helps, please click the Yes button
>
> > > Cheers,
> > > Shane Devenshire
>
> > > "Michael.Tarnowski" wrote:
> > > > On Feb 13, 10:24 pm, Shane Devenshire
> > > > <ShaneDevensh...@discussions.microsoft.com> wrote:
> > > > > Hi,
>
> > > > > What kind of groupings are we talking about when we say 2, 4, 6, 5?
>
> > > > > What is being grouped and how?  What fields, row fields, more than one row
> > > > > field, column fields, both row and column fields?  Are these fields groups on
> > > > > Month, Day (if so how many), Year, Hour, Minute, Second, Numbers?  Or are
> > > > > these manual groupings?  Are these groupings those generated by the Grouping
> > > > > command or by anding other row or column fields, or by checking and
> > > > > unchecking filter options?
>
> > > > > --
> > > > > If this helps, please click the Yes button
>
> > > > > Cheers,
> > > > > Shane Devenshire
>
> > > > > "Michael.Tarnowski" wrote:
> > > > > > Hi experts,
>
> > > > > > I want to enable users with few knowledge of pivot techniques to
> > > > > > change the grouping of a pivot chart resp. the underlying pivot table.
> > > > > > The idea is, to have a changeable cell value beneath the chart to
> > > > > > enter the group (groups of 2, 4, 6, 5, etc...). The associated pivot
> > > > > > table shall change it's groupings accordingly, thus forces to change
> > > > > > the associated chart.
>
> > > > > > Any idea, how to achieve this?
> > > > > > Thanks and have a nice day
> > > > > > Michael
>
> > > > Hi Shane,
> > > > thanks for your answer.
> > > > It is a manually grouping. Here is a picture:
> > > >http://michaeltarnowski.de/temp/Clipboard02.gif
>
> > > > Michael
>
> > Shane,
> > the grouping happens in the field "weeks open". As you see, "weeks
> > open" is currently grouped by 5 (manual click in pivot table, then a
> > right click, "Group and Show Detail>Group").
> > I'am looking for a VBA code to change this grouping by changing a cell
> > value outside the pivot table only  -   thus, no right click in the
> > table, no more menu selection of "Group and Show Detail>Group", etc.,
> > -- only entering a value.
> > Michael

Hi community,
I found a solution:

if worksheet A holds the pivot table, and worksheetB the chart and a
cell names "groups" and C13 is a cell in the pivot table.

Sub PivotGrouping()
' set grouping of pvtDelays table
'
    worksheetA.Activate
    Range("C13").Select
    Selection.Group Start:=True, End:=True, By:=worksheetB.Range
("groups").value
    worksheetB.Select
    ActiveSheet.ChartObjects(1).Activate
    ActiveChart.PivotLayout.PivotTable.RefreshTable
End Sub

Cheers Michael
0
emte69 (54)
2/15/2009 1:58:05 PM
Hi,

I just reread my previous post and see that my code was not sent.  Here is 
the solution I provided for you 

This code allows you to enter a value in H3 and have a pivottable group by 
numbers with a By value equal to H3.  E4 is the first data cell of the field 
you are grouping on.


Private Sub Worksheet_Change(ByVal Target As Range)
    Dim isect As Range
    On Error GoTo ErrorHandler
    Set isect = Application.Intersect(Target, Range("H3"))
    If Not isect Is Nothing Then
        If Target > 0 Then
            Application.EnableEvents = False
            Range("E4").Group Start:=True, End:=True, By:=Target
        End If
    End If
ErrorHandler:
    Application.EnableEvents = True
End Sub

-- 
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"Michael.Tarnowski" wrote:

> On Feb 15, 5:29 am, Shane Devenshire
> <ShaneDevensh...@discussions.microsoft.com> wrote:
> > --
> > If this helps, please click the Yes button
> >
> > Cheers,
> > Shane Devenshire
> >
> > "Michael.Tarnowski" wrote:
> > > On Feb 15, 1:19 am, Shane Devenshire
> > > <ShaneDevensh...@discussions.microsoft.com> wrote:
> > > > Hi,
> >
> > > > I see the picture, but I don't see 2, 4, 6, or 5 as option or values
> > > > anywhere in the picture.  So based on the picture, give me an example of what
> > > > you want to have happen.  I see the "before"  what will it look like "after"?
> >
> > > > Also, before I go too much further, keep in mind that the pivot table will
> > > > not change just by the user entering a number in a cell.  For that to happen
> > > > you will need to add VBA code.  Second, if the process, whatever it may be,
> > > > turns out to be fairly simple, I think you should teach the users how to do
> > > > it.  One of the problems with programming is that when you leave, if no one
> > > > else is a programmer and something goes wrong - nobody has a clue.
> >
> > > > --
> > > > If this helps, please click the Yes button
> >
> > > > Cheers,
> > > > Shane Devenshire
> >
> > > > "Michael.Tarnowski" wrote:
> > > > > On Feb 13, 10:24 pm, Shane Devenshire
> > > > > <ShaneDevensh...@discussions.microsoft.com> wrote:
> > > > > > Hi,
> >
> > > > > > What kind of groupings are we talking about when we say 2, 4, 6, 5?
> >
> > > > > > What is being grouped and how?  What fields, row fields, more than one row
> > > > > > field, column fields, both row and column fields?  Are these fields groups on
> > > > > > Month, Day (if so how many), Year, Hour, Minute, Second, Numbers?  Or are
> > > > > > these manual groupings?  Are these groupings those generated by the Grouping
> > > > > > command or by anding other row or column fields, or by checking and
> > > > > > unchecking filter options?
> >
> > > > > > --
> > > > > > If this helps, please click the Yes button
> >
> > > > > > Cheers,
> > > > > > Shane Devenshire
> >
> > > > > > "Michael.Tarnowski" wrote:
> > > > > > > Hi experts,
> >
> > > > > > > I want to enable users with few knowledge of pivot techniques to
> > > > > > > change the grouping of a pivot chart resp. the underlying pivot table.
> > > > > > > The idea is, to have a changeable cell value beneath the chart to
> > > > > > > enter the group (groups of 2, 4, 6, 5, etc...). The associated pivot
> > > > > > > table shall change it's groupings accordingly, thus forces to change
> > > > > > > the associated chart.
> >
> > > > > > > Any idea, how to achieve this?
> > > > > > > Thanks and have a nice day
> > > > > > > Michael
> >
> > > > > Hi Shane,
> > > > > thanks for your answer.
> > > > > It is a manually grouping. Here is a picture:
> > > > >http://michaeltarnowski.de/temp/Clipboard02.gif
> >
> > > > > Michael
> >
> > > Shane,
> > > the grouping happens in the field "weeks open". As you see, "weeks
> > > open" is currently grouped by 5 (manual click in pivot table, then a
> > > right click, "Group and Show Detail>Group").
> > > I'am looking for a VBA code to change this grouping by changing a cell
> > > value outside the pivot table only  -   thus, no right click in the
> > > table, no more menu selection of "Group and Show Detail>Group", etc.,
> > > -- only entering a value.
> > > Michael
> 
> Hi community,
> I found a solution:
> 
> if worksheet A holds the pivot table, and worksheetB the chart and a
> cell names "groups" and C13 is a cell in the pivot table.
> 
> Sub PivotGrouping()
> ' set grouping of pvtDelays table
> '
>     worksheetA.Activate
>     Range("C13").Select
>     Selection.Group Start:=True, End:=True, By:=worksheetB.Range
> ("groups").value
>     worksheetB.Select
>     ActiveSheet.ChartObjects(1).Activate
>     ActiveChart.PivotLayout.PivotTable.RefreshTable
> End Sub
> 
> Cheers Michael
> 
0
2/17/2009 6:21:27 PM
On Feb 17, 7:21 pm, Shane Devenshire
<ShaneDevensh...@discussions.microsoft.com> wrote:
> Hi,
>
> I just reread my previous post and see that my code was not sent.  Here is
> the solution I provided for you
>
> This code allows you to enter a value in H3 and have a pivottable group by
> numbers with a By value equal to H3.  E4 is the first data cell of the field
> you are grouping on.
>
> Private Sub Worksheet_Change(ByVal Target As Range)
>     Dim isect As Range
>     On Error GoTo ErrorHandler
>     Set isect = Application.Intersect(Target, Range("H3"))
>     If Not isect Is Nothing Then
>         If Target > 0 Then
>             Application.EnableEvents = False
>             Range("E4").Group Start:=True, End:=True, By:=Target
>         End If
>     End If
> ErrorHandler:
>     Application.EnableEvents = True
> End Sub
>
> --
> If this helps, please click the Yes button
>
> Cheers,
> Shane Devenshire
>
> "Michael.Tarnowski" wrote:
> > On Feb 15, 5:29 am, Shane Devenshire
> > <ShaneDevensh...@discussions.microsoft.com> wrote:
> > > --
> > > If this helps, please click the Yes button
>
> > > Cheers,
> > > Shane Devenshire
>
> > > "Michael.Tarnowski" wrote:
> > > > On Feb 15, 1:19 am, Shane Devenshire
> > > > <ShaneDevensh...@discussions.microsoft.com> wrote:
> > > > > Hi,
>
> > > > > I see the picture, but I don't see 2, 4, 6, or 5 as option or values
> > > > > anywhere in the picture.  So based on the picture, give me an example of what
> > > > > you want to have happen.  I see the "before"  what will it look like "after"?
>
> > > > > Also, before I go too much further, keep in mind that the pivot table will
> > > > > not change just by the user entering a number in a cell.  For that to happen
> > > > > you will need to add VBA code.  Second, if the process, whatever it may be,
> > > > > turns out to be fairly simple, I think you should teach the users how to do
> > > > > it.  One of the problems with programming is that when you leave, if no one
> > > > > else is a programmer and something goes wrong - nobody has a clue.
>
> > > > > --
> > > > > If this helps, please click the Yes button
>
> > > > > Cheers,
> > > > > Shane Devenshire
>
> > > > > "Michael.Tarnowski" wrote:
> > > > > > On Feb 13, 10:24 pm, Shane Devenshire
> > > > > > <ShaneDevensh...@discussions.microsoft.com> wrote:
> > > > > > > Hi,
>
> > > > > > > What kind of groupings are we talking about when we say 2, 4, 6, 5?
>
> > > > > > > What is being grouped and how?  What fields, row fields, more than one row
> > > > > > > field, column fields, both row and column fields?  Are these fields groups on
> > > > > > > Month, Day (if so how many), Year, Hour, Minute, Second, Numbers?  Or are
> > > > > > > these manual groupings?  Are these groupings those generated by the Grouping
> > > > > > > command or by anding other row or column fields, or by checking and
> > > > > > > unchecking filter options?
>
> > > > > > > --
> > > > > > > If this helps, please click the Yes button
>
> > > > > > > Cheers,
> > > > > > > Shane Devenshire
>
> > > > > > > "Michael.Tarnowski" wrote:
> > > > > > > > Hi experts,
>
> > > > > > > > I want to enable users with few knowledge of pivot techniques to
> > > > > > > > change the grouping of a pivot chart resp. the underlying pivot table.
> > > > > > > > The idea is, to have a changeable cell value beneath the chart to
> > > > > > > > enter the group (groups of 2, 4, 6, 5, etc...). The associated pivot
> > > > > > > > table shall change it's groupings accordingly, thus forces to change
> > > > > > > > the associated chart.
>
> > > > > > > > Any idea, how to achieve this?
> > > > > > > > Thanks and have a nice day
> > > > > > > > Michael
>
> > > > > > Hi Shane,
> > > > > > thanks for your answer.
> > > > > > It is a manually grouping. Here is a picture:
> > > > > >http://michaeltarnowski.de/temp/Clipboard02.gif
>
> > > > > > Michael
>
> > > > Shane,
> > > > the grouping happens in the field "weeks open". As you see, "weeks
> > > > open" is currently grouped by 5 (manual click in pivot table, then a
> > > > right click, "Group and Show Detail>Group").
> > > > I'am looking for a VBA code to change this grouping by changing a cell
> > > > value outside the pivot table only  -   thus, no right click in the
> > > > table, no more menu selection of "Group and Show Detail>Group", etc.,
> > > > -- only entering a value.
> > > > Michael
>
> > Hi community,
> > I found a solution:
>
> > if worksheet A holds the pivot table, and worksheetB the chart and a
> > cell names "groups" and C13 is a cell in the pivot table.
>
> > Sub PivotGrouping()
> > ' set grouping of pvtDelays table
> > '
> >     worksheetA.Activate
> >     Range("C13").Select
> >     Selection.Group Start:=True, End:=True, By:=worksheetB.Range
> > ("groups").value
> >     worksheetB.Select
> >     ActiveSheet.ChartObjects(1).Activate
> >     ActiveChart.PivotLayout.PivotTable.RefreshTable
> > End Sub
>
> > Cheers Michael

Hi Shane,
thank you to share your code with me. I assume both cells H3 and E4
are on the same worksheet. - I was looking for a code to handle H3 on
sheet A and E4 on sheet B and came up with my snippet.
Michael
0
emte69 (54)
2/18/2009 8:37:41 AM
Reply:

Similar Artilces:

cell looses name after sorting
Can someone help me with the following problem in Excel 2000: in a table I have attached serveral cells with unique cell names, the values in these cells are used in other sheets. the problem is that when I sort the table, the cell names stay in the original rowposition; they are not sorted! while their values are. So Cell names get different values, and other calculations on my other sheets get messed up! How can I make the cell names relative instead of absolute? thankx in advance, Jim --- Message posted from http://www.ExcelForum.com/ "jimfx >" <<jimfx.109zcv@exc...

Sort cells and "Place in this document"-hyperlinks
Dear group, I am using a table with multiple columns that are used as a database. Each column is one data entry. I am having some hyperlinks that point from one data entry (i.e. column) to another inside the spreadsheet. Unfortunately, when I perform a sort of the columns, these hyperlinks remain pointing to the previous location inside the sheet, i.e. to the wrong column after the sort. How do I solve this, i.e. how I make Excel understand that these hyperlinks need to be updated while sorting the table? Thank you for any advice Tom Better to see so send to me if you like at dguille...

Pivot Tables #4
Hello you experts out there. I nned some Pivot table advice ( a website address for basics would be great), for instance how to excplain pivots and how to create them. I use lots of products with lots of sizes from various suppliers to name but a few columns. Is there a limit as to the amount of columns of data? Thank you very much. H Hi check out Debra Dalgleish's site - http://www.contextures.com/tiptech.html - she has a link to Jon Peltier's site which explains PT basics and then lots more interesting info on them. -- Cheers JulieD check out www.hcts.net.au/tipsandtric...

Pivot Table Counting
I am having trouble trying to calculate fields through a pivot table. Basically, I have a data set that looks like this: Record Number State Value 1 CA 0 2 CA 12 3 CA 15 4 NJ 0 5 NJ 10 I want to set up a pivot table that will show 2 columns, one with th total number of records and one with the total number of records wit non-zero values. Both of the...

Pivot Tables
Hi, I was windering if some one could provide me with a link to a tutorial for what I am trying to do. I have an aggregate table. This table has several groups and several columns. The intersection of a group and column is an aggreate value such as Sum function of a column value in that group. Normally a Pivot table shows 1 aggregate value at the intersection of a group and a column. What I want is: To show more than one value at the intersection besides the aggregate value. In other words, if a simple pivot table cell is: Aggr(x,y) where aggr is an aggregate function such a...

Changing a file name
Say I have a file, TestFile.exe... I want to programmatically change it's filename to TestFile2.exe (and delete the original). Is this possible using MFC? Or do i have to use dos commands? "hamishd" <Hamish.Dean@gmail.com> wrote in message news:1179372807.798486.245460@q75g2000hsh.googlegroups.com... > Say I have a file, TestFile.exe... I want to programmatically change > it's filename to TestFile2.exe (and delete the original). Is this > possible using MFC? Or do i have to use dos commands? > Use the rename() function in the C-RTL. -- David This i...

Stopping free text entry in validation cell
Hi, I have an xls that I have set up with validation lists in some cells. I need to stop users from ignoring the options in the list and just typing whatever the want in the cell. Anyone help? I am sure it is easy, but can't see how to do it. Thnx, Smf If you are using a list then that should be enough unless they copy and paste into the validation cell -- Regards, Peo Sjoblom "smf" <smf@discussions.microsoft.com> wrote in message news:448D4166-A2C9-4C25-852F-7B045DF19F98@microsoft.com... > Hi, > > I have an xls that I have set up with validation lists...

Highlighting cells
When I select cells to copy or paste I can't really see which cells are highlighted because I probably have something set wrong. I would like the cells I highlight to have a light background color so I can see what is selected. Any help would be appreciated!! joe1@peacocks.com In MacXL, the highlight color is set in system preferences. Choose System Preferences/Appearance pane, and change the highlight color to something more contrasting. Otherwise, you'll need to use VBA, e.g.: http://cpearson.com/excel/excelM.htm#HighlightActiveCell Though a better way is via Chip Pearson...

Pivot Chart Formatting #5
How can I format a Pivot Chart and keep the customized format when refreshed? This is a known issue by Microsoft. Short answer, you can't do it. =( One possible work around is to record a macro of you setting the formatting of the chart, and then set it up so that the macro runs whenever the chart calculates. -- Best Regards, Luke M *Remember to click "yes" if this post helped you!* "Germeny Santos" wrote: > How can I format a Pivot Chart and keep the customized format when refreshed? Hi, This is dependent on what custom formatting you are refering to. T...

join multiple pivot tables?
How can I link up multiple pivottables all based on the same data where all i would have to do is change the page option (drop down menu) from the first pivot and the rest of the pivots would automatically adjust to match those? There's a sample file here in which you can change the page field in one pivot table, and all the related pivot tables change: http://www.contextures.com/excelfiles.html Under Pivot Tables, look for 'PT0021 - Change All Page Fields' or 'PT0008 - Change Multiple Page Fields' clueless_in_mempjhis wrote: > How can I link up mu...

How to Tab over to a specific cell... not the adjacent one?
In order to make a form more user friendly, I would like to allow the user to use the "Tab" key to jump from one input field to another (unlike moving to the adjacent cell). Is this possible? Thanks in advance for your suggestions. Regards, SK Lock all cells> unlock desired cells>lock worksheet>test -- Don Guillett SalesAid Software donaldb@281.com "SK" <sk_nj_junk@yahoo.com> wrote in message news:060101c42bc0$e4c1fc50$7d02280a@phx.gbl... > In order to make a form more user friendly, I would like > to allow the user to use the "Tab" k...

Help with pivot table
I'm after some help with a pivot table I have created a work book to log certain defects, and would like to use a pivot table to show defects per unit on an improvement tracker, is it possible to have the pivot table to shift cells to the right when it is updated and required more columns so it doesn't overwrite data on the sheet it would be like this the componet fault unit numbers & Total defects are the pivot table & the action would be the start of the manual data Compontent Fault Unit Numbers Total Defects Action 1 2 3 4 5 Light Inop 1 1 ...

moving data dynamically based on empty cell
I have a data sheet that looks like this... col a col b abc 10 20 45 efg 5 18 10 I need it to look like this... col a col b abc 10 abc 20 abc 45 efg 5 efg 18 efg 10 since there is no consistency to the number of rows in col b with data, i have to come up with a formula that is dynamic The file has 20,000 rows so doing it manually is not the way to go. Thanks Give this macro a try... Sub FillInTheBlanks() Dim Area As Range, LastRow As Long Const ColLetter As String = "A&...

Group box, option button and cell reference
I need option buttons across six rows. I need the user to only have one option PER row. Help feature says to place option buttons into a Group Box but I can't figure out how to do that. It also says to have cell reference???? Any suggestions? If you use the option buttons from the Forms toolbar rather than the Controls toolbar, you can place them inside a group box (also from the forms toolbar). Right-click the option button and choose Format control. In the control tab, enter a cell reference to contain the value of the option button(which will be 1-6 for 6 buttons within the ...

Merge Cells, but keep backgrounds
In excell 2003 is there a way to merge cells so the text spans them all, but keep the current background of the cells (which are not all the same color)? No Try Center Across Selection and avoid merged cells whenever possible. Gord Dibben MS Excel MVP On Sat, 30 May 2009 09:16:12 -0700 (PDT), "dan@danirwin.net" <dan@danirwin.net> wrote: >In excell 2003 is there a way to merge cells so the text spans them >all, but keep the current background of the cells (which are not all >the same color)? Is there a way to center across selection vertically or just horizonta...

security of a cell
is it possible to protect a range of cells, so that it i wanted to change them a box could appear requesting the password to access the cells. i would idelly like to set this up so that the need to go through the top menu is bypassed. ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ This was added in xl2002 as a built in feature. Before that version, you'd need a macro. And if the user opened the workbook without enabling macros, it wouldn't be effective. c...

Can I permanently delete/hide data within Pivot Tables?
Microsoft Excel 2002 I have 155 clients which I need to run Pivot Tables for! All with the same pivot table layout. Is it possible to run the Pivot table with the 155 clients as a Template basically, then somehow delete or permanently hide the data leaving only one client, so that I can save multiple copies for each of the individual clients? Or can I set up a pivot table where I can automatically feed in parameters? Client details are stored on an Oracle database! Hi Peter, Right-click on a Page Field and select Field Settings from the context menu, then click the Advanced button. Yo...

IMPLEMENT_SERIAL (Changing the Base Class)
This might be a stupid question, or it could be incredibly insightful... ...but hope it's not the latter. I have a class that is probably about 3 levels away from the CObject class. Like this: CObject->ClassA->ClassSerialMe Currently I serialize this object with the usual: IMPLEMENT_SERIAL(ClassSerialMe, ClassA, VERSIONABLE_SCHEMA | 1 ) What would I need to do to change the base class of ClassA to: CObject->ClassB->ClassSerialMe And use the Serialize functionailty to a differnt version: IMPLEMENT_SERIAL(ClassSerialMe, ClassB, VERSIONABLE_SCHEMA | 2 ) I...

Counting Non Blank Cells
I could really use some help with this headache. I'm using Excel 2003. I'm doing a Vlookup comparing text data in Column A of Worksheet 1 to text data in Column C of Worksheet 2. If there's a match I'm having the result placed in Column B of Worksheet 1. When there's no match I get a blank which is fine. I'm comparing about 10,000 records in Worksheet 1 to about 8,000 records in Worksheet 2. I need a way to get a count of only the matched records in Column B. I've tried using the The CountA function for Column B, but I get the exact same counts in Column B ...

In Excel, how can a range of Pos #'s be changed to negative num
I dulicate a large series of cells that are all positive. Is there a shortcut to change them to all negaive? Hi, Type -1 in a cell, copy that and then select the range, which has the positive numbers which you want to convert to negative. Right click on the range, select paste special, and choose action as 'Muliply'. Regards Govind. Stuart Millner wrote: > I dulicate a large series of cells that are all positive. Is there a > shortcut to change them to all negaive? Perfect, thanks a million, what an easy solution.... "Govind" wrote: > Hi, > > ...

Change in File size
Hi, One workbook has 4 sheets size of file is approxiamtly 1 MB after erasing 3 sheets and saving the size of file with one sheet (tables-1 left) is 744 KB only I then copy that sheet (tables-1) to another workbook that has other sheets the size of the whole workbook was only 490 KB. Is there a reason for this? Actually this happens a lot with me. When I copy on sheet from one open workbook to another open workbook the size of the file copyed to goes up to 3 times larger in size. Can any one help ? On Sun, 22 Apr 2007 20:34:04 +0300, "Khalil Handal" <khhandal@stthom.edu>...

Hyperlink in Pivot Table
Is it possible to put hyperlinks into a pivot table to go to the detail in other worksheets? I have a top 10 list of components with issues and would like the user to be able to click on the component to go to the list of issues. I thought if I put the hyperlink in the cell where the pivot table is getting it's info, it would come through, but that didn't work. Any suggestions? Thanks Hi Just double clicking on the cell with the data of interest, will open another sheet showing all of the entries making up that value. Delete the newly created sheet after you have finished w...

Insert Cell Text Into Chart
I have a cell of text(on sheet 1) that I want to paste into the top portion of a chart (on sheet 2) - I have done this before, but I cannot remember how - HELP! Hi insert a textbox, select this textbox and enter the equation sign '='. Now select your cell on sheet 1 and hit ENTER -- Regards Frank Kabel Frankfurt, Germany Karen wrote: > I have a cell of text(on sheet 1) that I want to paste > into the top portion of a chart (on sheet 2) - I have done > this before, but I cannot remember how - HELP! Thank you for your help - I'm sorry, maybe I didn't explain it ...

Pivot Tables #40
Does anyone know if there is a way to quickly clear a field list? I can't find a keyboard shortcut or anything else in any of the help/support avenues I've tried. Thanks in advance for the help. -- ERR229 Are you trying to clear all the check boxes in the field's dropdown list? In Excel 2002 and later versions, there's a Show All checkbox. In Excel 2000, and earlier versions, you can use programming to hide or show the items -- there's sample code here: http://www.contextures.com/xlPivot03.html ERR229 wrote: > Does anyone know if there is a way to quickl...

formula for cell
I have many cells with descriptive text, does anyone know of a formula where I can take for instance a cell with 500 characters and take only the first 30 and paste it in to a new cell. I have used a formula thanks to Gary =left(a1,len(a1)/2 which has worked for other uses I have--now I need to extract only the first 30 characters of a description and I have thousands of cells in my description column..Please Help =left(a1,30) Pete.Cornejo@gmail.com wrote: > > I have many cells with descriptive text, does anyone know of a formula > where I can take for instance a cell with 500...