MACRO with looping

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table with customer id no, name, days and daily purchase number. I used a macro to summarize the table on a weekly basis as listing the customer names, weekly purchase totals(used autofilter to select customer names, subtotal for total purchase for each customer. But could not find a way to make macro to everytime select following customer in filter menu. I can do it by manually writing the names of customers in macro. But if it can be looped to select the following customer, it would be very helpful. Thanks a lot
 
Hi
have you consideres using a pivot table for this. Take a look at
http://www.cpearson.com/excel/pivots.htm
http://peltiertech.com/Excel/Pivots/pivotstart.htm
http://www.contextures.com/xlPivot02.html

--
Regards
Frank Kabel
Frankfurt, Germany

STEVEVAI said:
I have a table with customer id no, name, days and daily purchase
number. I used a macro to summarize the table on a weekly basis as
listing the customer names, weekly purchase totals(used autofilter to
select customer names, subtotal for total purchase for each customer.
But could not find a way to make macro to everytime select following
customer in filter menu. I can do it by manually writing the names of
customers in macro. But if it can be looped to select the following
customer, it would be very helpful. Thanks a lot
 
Something like this maybe??? Modify to suit.

Sub gothrufiltered()
For Each c In Range("a1:a21").SpecialCells(xlCellTypeVisible)
MsgBox c.Offset(, 2)'or application.subtotal()
Next
End Sub

--
Don Guillett
SalesAid Software
(e-mail address removed)
STEVEVAI said:
I have a table with customer id no, name, days and daily purchase number.
I used a macro to summarize the table on a weekly basis as listing the
customer names, weekly purchase totals(used autofilter to select customer
names, subtotal for total purchase for each customer. But could not find a
way to make macro to everytime select following customer in filter menu. I
can do it by manually writing the names of customers in macro. But if it can
be looped to select the following customer, it would be very helpful. Thanks
a lot
 

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

Back
Top