How to paste range for every row with "where statement"

Brutusar

Board Regular
Joined
Nov 23, 2019
Messages
166
Office Version
  1. 365
Platform
  1. Windows
I have a sheet A with up to ca 65 000 rows. In a different sheet B,I have several ranges of data. All ranges i both sheets have identical colums.

What I need to do is two is a step one witch is simple, and a step two not so simple.

Step 1 is to copy/paste a range from sheet B under each row in the range in Sheet A without any conditions. (See example)

Step 2 is to copy paste a different range that should only be pasted if a condition is met i sheet A. For example, if Year is 2015 in sheet A, the range from sheet B should be pasted. This will be much like a "WHERE" clause in MySQL for example.

As these conditions may change it is possible best to use a input box for the conditions?

Any suggestions how to do this so the code is not too slow. I have written a sub using a lot "Finds", but it takes forever to run.
 

Attachments

  • Excel example.PNG
    Excel example.PNG
    80.5 KB · Views: 3

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Forum statistics

Threads
1,215,013
Messages
6,122,694
Members
449,092
Latest member
snoom82

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