Exporting data to new sheet with conditions.

jlokesh16

New Member
Joined
Jan 22, 2015
Messages
39
I have sheet1, where there is a table in below format.

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[/TR]
[TR]
[TD]Prop ID:[/TD]
[TD]Leads ID:[/TD]
[TD]Caller Category:[/TD]
[TD]Duration:[/TD]
[TD]Type:[/TD]
[TD]Name[/TD]
[TD]Date[/TD]
[TD]Link[/TD]
[/TR]
[TR]
[TD]ONI10P07[/TD]
[TD]7631565[/TD]
[TD]Prospect New[/TD]
[TD]5[/TD]
[TD]Phone[/TD]
[TD]Jack Hill[/TD]
[TD]09/04/2018[/TD]
[TD]www.google.com[/TD]
[/TR]
[TR]
[TD]ONI10P07[/TD]
[TD]7631578[/TD]
[TD]Prospect Followup[/TD]
[TD]20[/TD]
[TD]Phone[/TD]
[TD]Jack Hill[/TD]
[TD]09/04/2018[/TD]
[TD]www.google.com[/TD]
[/TR]
[TR]
[TD]ONI10P07[/TD]
[TD]7631581[/TD]
[TD]NonLead Resident[/TD]
[TD]35[/TD]
[TD]Phone[/TD]
[TD]Jack Hill[/TD]
[TD]09/04/2018[/TD]
[TD]www.google.com[/TD]
[/TR]
</tbody>[/TABLE]

In sheet2, i have the below table:

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]Category[/TD]
[TD]Times[/TD]
[/TR]
[TR]
[TD]Prospect New[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]Prospect Followup[/TD]
[TD]2[/TD]
[/TR]
</tbody>[/TABLE]

I am looking for a macro, when i run it, the categories defined in sheet 2 should search in sheet1 col C and export the number of entries defined per user (User name in F col of sheet 1)
EG: Category 1 (Prospect New) will search 3 random entries in Sheet 1 Col C for Jack hill, and export 3 random entries containing Col C as prospect New Name as and Jack Hill. The user name list is in Sheet 2 Col D.
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Forum statistics

Threads
1,224,823
Messages
6,181,171
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top