Autofilter criteria based on cell value

C

Craig

I have summary data of sales in the following format:


Salesperson Amount
John 5000
Jill 9000

etc.


I have a separate spreadsheet which gives me the detail for the above information.

Salesperson Client Month Discount Amount
John C1 May 20% 1000
Jill C2 June 15% 2000
Peter C3 June 10% 5000
Jill C4 June 5% 4000
John C1 June 10% 3000
Jill C2 July 5% 2000
etc



Is it possible to use VBA to autofilter the detailed data by Salesperson, using the names in the summary detail, print off the filtered detail, and then for it to loop to the next Salesperson in the summary data?

I know there are other ways of getting the info into the right format (pivot tables etc, but I am particularly interested in a macro which could do this as there are various other uses I could have for this sort of macro)

Thanks in advance.

Craig
 
T

Tom Ogilvy

You should be able to adapt the code on Ron de Bruin's site to do this

http://www.rondebruin.nl/copy5.htm

--
Regards,
Tom Ogilvy


I have summary data of sales in the following format:


Salesperson Amount
John 5000
Jill 9000

etc.


I have a separate spreadsheet which gives me the detail for the above
information.

Salesperson Client Month
Discount Amount
John C1 May
20% 1000
Jill C2 June
15% 2000
Peter C3 June
10% 5000
Jill C4 June
5% 4000
John C1 June
10% 3000
Jill C2 July
5% 2000
etc



Is it possible to use VBA to autofilter the detailed data by Salesperson,
using the names in the summary detail, print off the filtered detail, and
then for it to loop to the next Salesperson in the summary data?

I know there are other ways of getting the info into the right format (pivot
tables etc, but I am particularly interested in a macro which could do this
as there are various other uses I could have for this sort of macro)

Thanks in advance.

Craig
 

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