ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

any excel pivot table experts out there?

(1/2) > >>

superboyac:
I have a excel sheet that shows individual basketball players that gets updated daily to show win/loss record of that day, and the total win/loss record overall.  I'd like the table to automatically get sorted every day so that the person with the best winning percentage is on top.  How can I do this with pivot tables?  Whenever I try to make a pivot table, I can't get it do to this kind of automatic sorting.  I don't even know if this is possible with pivot tables or something else.  Thanks.  Here's a screenshot of the excel sheet.
any excel pivot table experts out there?

AbteriX:
Don't know the syntax correctly out of mind
but you can script Excel with VBA (Visual Basic for Application)

You can look for an script with an
"OnLoad"-action like:

With Worksheet
If Target <> "" Then
x1 = Selection.Row
y1 = Selection.Column
Columns("A:Z").Select
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Cells(x1, y1).Select
End If
End With


Sorry, just an hint.

---
Edit:
I have found some help and better code example with google:
http://pubs.logicalexpressions.com/pub0009/LPMArticle.asp?ID=302
http://www.anthony-vba.kefra.com/vba/vbabasic2.htm

greeds
Stefan

superboyac:
ooo...I try to avoid VBA whenever possible.  It's always a big headache for me.

Target:
if you're building pivots manually, you can set the sort order and field in the layout options dialog (apologies if this isn't exactly correct - it's not something I use very often - but it'll get you started)

double click on the field header, then select advanced.

Set the sort order (descending?) and the field name (it will probably default to the 'active' column anyway).

you can force your pivot to refresh on open under the options dialog (or select TABLE OPTIONS from the pivot context menu) - last check box is refresh on open

superboyac:
Actually guys, I decided that this is something better suited for Access.  I'm going to try to create it in there.  Ugh...Access...so complex.

Navigation

[0] Message Index

[#] Next page

Go to full version