ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help in printing a sorted list of customers purchases (https://www.excelbanter.com/excel-programming/415432-help-printing-sorted-list-customers-purchases.html)

jonco

Help in printing a sorted list of customers purchases
 
I'm keeping track of an auction. I have a worksheet with 4 columns,
Item Number, Item description, Buyer and Amount = Columns A thru D.
What I want to do is sort the list by buyer and then copy just the items
from each buyer and paste that buyers items (and related data) to a
place in the spreadsheet (the printable receipt area), lets call that
starting at cell L6.
Then I can print his receipt and then repeat the task for each
subsequent buyer.

I have it working manually, (I can copy the buyers data to the receipt
area and then print the receipt) but it would be nice to automate the
process.

Any help would be greatly appreciated.

Jonco

Gary Keramidas

Help in printing a sorted list of customers purchases
 
use autofilter.

if using excel 2003, enter a formula in the last row of column D
=subtotal(109,D2:d100)
(or whatever your last row is)


select a1:d1
then
data/filter/autofilter
select the buyer name from the dropdown in column C

you should see the transactions for the buyer with the total




--


Gary


"Jonco" wrote in message
...
I'm keeping track of an auction. I have a worksheet with 4 columns, Item
Number, Item description, Buyer and Amount = Columns A thru D.
What I want to do is sort the list by buyer and then copy just the items from
each buyer and paste that buyers items (and related data) to a place in the
spreadsheet (the printable receipt area), lets call that starting at cell L6.
Then I can print his receipt and then repeat the task for each subsequent
buyer.

I have it working manually, (I can copy the buyers data to the receipt area
and then print the receipt) but it would be nice to automate the process.

Any help would be greatly appreciated.

Jonco




Gary Keramidas

Help in printing a sorted list of customers purchases
 
here's some code to automate it, change the sheet name if yours is different:

Sub summarize()
Dim ws As Worksheet
Dim lastrow As Long
Set ws = Worksheets("Sheet1")
lastrow = ws.Cells(Rows.Count, "A").End(xlUp).Row

ws.Range("D" & lastrow).Offset(1).Formula = _
"=subtotal(109,D2:D" & lastrow & ")"

With ws.Range("A1:D1")
.AutoFilter
End With
End Sub


--


Gary


"Jonco" wrote in message
...
I'm keeping track of an auction. I have a worksheet with 4 columns, Item
Number, Item description, Buyer and Amount = Columns A thru D.
What I want to do is sort the list by buyer and then copy just the items from
each buyer and paste that buyers items (and related data) to a place in the
spreadsheet (the printable receipt area), lets call that starting at cell L6.
Then I can print his receipt and then repeat the task for each subsequent
buyer.

I have it working manually, (I can copy the buyers data to the receipt area
and then print the receipt) but it would be nice to automate the process.

Any help would be greatly appreciated.

Jonco




jonco

Help in printing a sorted list of customers purchases
 
Thanks Gary, I'll give that a try.



All times are GMT +1. The time now is 05:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com