If value in sheet 1 in cell x is ="1" then copy row from sheet 2 and replace ish

Whaletacos

New Member
Joined
Aug 10, 2017
Messages
13
Hello you brilliant people of the internet! :)
I have a smaller problem with getting vba to do what I want it to (big surprise there)

So, my task is two part, but starts roughly like this;

I have an "embedded if/and" that returns a value if two cells match. The value is from 1 to 10.

Now I need a sub to do the following;
lets say


If Range("O2") in "sheet1" is =1, then copy rows "4:4:" to "sheet1" activerow.
If Range("O2") in "sheet1" is =2, then copy rows "6:6:" to "sheet1" activerow.
If Range("O2") in "sheet1" is =3, then copy rows "7:7:" to "sheet1" activerow.

(I did not use code brackets as it isnt proper code)
Pardon for the poorly written example.
But the trick part is, that I want to copy the rows WITHOUT replacing existing data in the row. (Don't know if this is even possible)

I hope you wise people if the internet is capable to help this poor self taught vba noob.

Kind regars
WhaleTacos
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
what do you mean by rows "7:7"?

If you could post a sample of your two sheets an how if O2 = 1 would look in your Sheet1
 
Upvote 0

Forum statistics

Threads
1,224,830
Messages
6,181,229
Members
453,026
Latest member
cknader

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