need help with pivot table formating

M

magickarle

Hi ti all:
I got a pivot table getting data from an odbc SQL server.
The first column is agent ID, the second one is supervisor, the third
is agent name and the fourth one is the call volume. Here is an
example:
AgentID Name Supervisor Call volume
01 Nick Super1 10
Nick Super1 4
02 John Super1 5
03 Marie Super2 8

If I do a Vlookup for agentID 01, I'll get call volume of 10 but in
fact it's 14 since Nick got 10+4.
I can't combine a sum with vlookup with the name since Nick is not the
only name showing in the pilot table.
I need to find a way of calculating call volume of agentid 01 untill I
get a different agentid in a vlookup.
Thanks a bunch!
 
M

magickarle

Hi ti all:
I got a pivot table getting data from an odbc SQL server.
The first column is agent ID, the second one is supervisor, the third
is agent name and the fourth one is the call volume. Here is an
example:
AgentID Name Supervisor Call volume
01 Nick Super1 10
Nick Super1 4
02 John Super1 5
03 Marie Super2 8

If I do a Vlookup for agentID 01, I'll get call volume of 10 but in
fact it's 14 since Nick got 10+4.
I can't combine a sum with vlookup with the name since Nick is not the
only name showing in the pilot table.
I need to find a way of calculating call volume of agentid 01 untill I
get a different agentid in a vlookup.
Thanks a bunch!

Here the macro I created. it's seems to work. if anynone want to tweek
it so it's more efficient, you're welcome
Sub copydate()
Row = Row + 1
totalrows = ActiveSheet.UsedRange.Rows.Count
daterow = daterow + 1
agentrow = agentrow + 1
For Row = Row To totalrows
If Cells(Row, 3) = 0 Then
daterow = Cells(Row - 1, 3)
' Cells(Row, 2).Value = daterow
Cells(Row, 3).Value = daterow
End If
Next Row
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top