How to Copy rows from one sheet to another based on the criteria in the second sheet

dsubash

New Member
Joined
Nov 22, 2024
Messages
1
Office Version
  1. 2019
  2. Prefer Not To Say
Platform
  1. Windows
Dummy.xlsx
ABCDEFG
1Sl. NoLocationDateSalesCollectedDueName of Employee
21Sydney01/11/20245005000SELF
32Ireland01/11/2024243024300SELF
43Japan01/11/20245505500SELF
54Tokyo01/11/20243503500SELF
65Delhi01/11/2024293002930SELF
76Ohio01/11/20245505500SELF
87New Jersey01/11/20245505500SELF
98Bangkok01/11/2024273027300SELF
109Bangalore01/11/20243003000SELF
1110Sydney01/11/20242802800SELF
1211Ireland01/11/20244004000SELF
1312Japan01/11/20242202200SELF
1413Tokyo01/11/2024145014500SELF
1514Delhi01/11/20244004000SELF
1615Ohio01/11/2024184018400SELF
1716Sydney01/11/20241001000SELF
1817Ireland01/11/20243503500SELF
1918Sydney01/11/20241001000SELF
2019Ireland01/11/20242502500SELF
2120Japan01/11/2024185018500SELF
2221Tokyo01/11/2024190000SELF
2322Delhi01/11/20241801800OWN
2423Ohio01/11/20241000100KLM
2524New Jersey01/11/20241000100OWN
2625Bangkok01/11/20241000100OWN
2726Sydney01/11/20241001000KLM
2827Ireland01/11/20241300130KLM
2928Japan01/11/20241200120KLM
3029Tokyo01/11/20242802800KLM
3130Delhi01/11/20244004000SELF
3231Sydney01/11/20243103100KLM
3332Ireland01/11/20243800380QRS
3433Japan01/11/20241200120QRS
3534Tokyo01/11/202440400KLM
3635Delhi01/11/20245505500SELF
3736Ohio01/11/2024217021700SELF
3837New Jersey01/11/20241300130OWN
3938Bangkok01/11/20241300130OWN
4039Bangalore01/11/20241300130OWN
4140Sydney01/11/2024103001030KLM
4241Ireland01/11/20241000100KLM
4342Japan01/11/20243700370KLM
4443Tokyo01/11/20243700370KLM
4544Delhi01/11/202450500SELF
4645Ohio01/11/20241001000VWX
4746New Jersey10/11/20241000100KLM
4847Bangkok10/11/20242500250KLM
4948Bangalore10/11/202480080KLM
5049Sydney10/11/20241001000PQR
Daily Transaction



Dummy.xlsx
ABCDEFGHIJK
1ABC Limited
2Daily Sales Update
3
4Date18/11/2024NameSELF
5
6
7Sl. No.NameLocationDateSalesPaidDue
81SELFDelhi18/11/20241000100
92SELFDelhi18/11/20241000100
103SELFDelhi18/11/202470070
114SELFDelhi18/11/20241000100
125SELFDelhi18/11/20241000100
136SELFDelhi18/11/20242800280
147SELFDelhi18/11/20242300230
158SELFDelhi18/11/20244000400
16
Report
Cells with Data Validation
CellAllowCriteria
F4List=Names



Dear All,

I have a database sheet (Daily Transaction) which contains details like name, date, location, sales, collections, dues etc for a specific month.

I need to copy all rows from the master sheet to another sheet (Report) with Name and Date as Criteria to be entered in the report sheet.

Attached is the sample file for reference. When the name and date is changed in the report sheet, i need all rows containing specific name and date to be copied in the report sheet.

Any Formula or VB would be of great help. I am using Office Professional 2019.

Thanks in advance.
Subash D
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Set up your report sheet like the pciture below(the headers and the criteriafields in K1:L2). When you did that, you can use this oneliner in VBA

VBA Code:
Sub jec()
Sheet1.Cells(1).CurrentRegion.AdvancedFilter 2, Sheet2.Range("K1:L2"), Sheet2.Range("A1:G1")
End Sub


1732284398922.png
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,327
Members
452,635
Latest member
laura12345

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