I need a Macro to extract data by customer to new worksheets

  • Thread starter charles.w.price
  • Start date
C

charles.w.price

I need help. I have spreadsheets that are automatically created every
month. They have 9 different columns that include Date, Ticket #,
Customer, Job, Truck ID, Product, Gross, Tare, and Net. All this is
in 1 main worksheet.

How could I create a macro that would Separate the different customers
to different worksheets and automatically sort them by date? Also,
what if I have different jobs for the same customer, could I make the
macro separate the different jobs to different worksheets?

One more thing, when the new worksheet is created, could the macro
name the new worksheet by the customer name?

Any help would be greatly appreciated.

Thanks,
Charles
 
G

Guest

Depending what your source data looks like I would suggest using a pivot
table. By using the show pages feature it will create all of the seperate
sheet that you describe. If you want more help persuing this just reply
back...
 
C

charles.w.price

Depending what your source data looks like I would suggest using a pivot
table. By using the show pages feature it will create all of the seperate
sheet that you describe. If you want more help persuing this just reply
back...

I will at least give it a try. I don't know that a pivot table is
what I am looking for but I will see. What do I need to do?
 
R

Ron de Bruin

If your range start in A and you want to filter on column C

then change

rng.Columns(1).AdvancedFilter _
Action:=xlFilterCopy, _
CopyToRange:=.Range("IV1"), Unique:=True

To

rng.Columns(3).AdvancedFilter _
Action:=xlFilterCopy, _
CopyToRange:=.Range("IV1"), Unique:=True


See the VBA help for application.inputbox
If you need more help post back
 
C

charles.w.price

If your range start in A and you want to filter on column C

then change

rng.Columns(1).AdvancedFilter _
Action:=xlFilterCopy, _
CopyToRange:=.Range("IV1"), Unique:=True

To

rng.Columns(3).AdvancedFilter _
Action:=xlFilterCopy, _
CopyToRange:=.Range("IV1"), Unique:=True

See the VBA help for application.inputbox
If you need more help post back

Ron,

Thanks a lot! I have looked at the help but do not understand how I
would apply the input box. Could you give me some guidance?
 

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