Macro to list all data for two criteria

rrajansg

New Member
Joined
Mar 17, 2011
Messages
12
Can anyone help to give macro

Data title

A1 Staff Name
B1 Customer Name
C1 country
D1 type of sales

etc. upto Column L

X ABC India
X PLM USA
Y SY India
Y QE Japan
Y DE India



Report required in another sheet

if I give two criteria "Staff name" & "country" in A1 & B1
I should get all the rows with this Staff name and country

If I query Y and India, result would display all the columns for Y and India
Y SY India
Y DE India

Thanks in advance
 
Last edited:

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Hi and welcome to the board!!
Have you looked at either the AutoFilter or Advanced Filter? IS it really necessary to move the data to Column "L" or do you just need to view it. You might also consider a Pivot Table.

lenze
 
Upvote 0
Thanks

I tried auto filter. It serves the purpose. But I am thinking of something in macro. I have to generate report separately. I will not move any data from the master worksheet. Whatever reports I generate, it is independant of master data.

Rajen
 
Upvote 0

Forum statistics

Threads
1,224,548
Messages
6,179,451
Members
452,915
Latest member
hannnahheileen

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