search for value then copy and paste a range

jacojvv

New Member
Joined
Aug 13, 2012
Messages
5
Hi
Say i have the following data on sheet1 and i want a vba that searches where cell G1 = 22 and cell H = 47 then copies cell range A1 to E6(the first match) to sheet 2, leaves a blank line open and then copies cells A13 to E18(second match) to sheet 2 and carries on until no more matches are found

Thanks
Jaco

A B C D E F G H
221144403652247
3583026282536
103416113
17187242
455331231
113317451852546
2124436312633
2616133430
22528421
35107840
3013188752247
1351028364337
4233121644
114553440
222263117



<colgroup><col width="64" span="8" style="width:48pt"> </colgroup><tbody>
</tbody>
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Forum statistics

Threads
1,216,783
Messages
6,132,684
Members
449,748
Latest member
freestuffman

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