Copy specific cells to another sheet BUT if there is "text" in destination, try another spot, or another

Luvlimum

New Member
Joined
Oct 19, 2021
Messages
7
Office Version
  1. 2010
Platform
  1. Windows
I have trowelled through as many posts to see if this has been addressed and I cannot seem to find anything that fits. Please note I am very new to VB and I am learning. In saying that ...

I would like to copy Cells C6:D13 FROM Sheet1
to C6:D13 of Sheet 2
BUT If there is already text in C6:D13 of Sheet2, I would like it to try pasting it to C15:D15 of Sheet2
IF there is already text in C15:D15 of Sheet 2, then I want it to look at C24:D24 of Sheet2
IF there is already text in C24:D24 of Sheet2, then try C33:D33 of Sheet2 and so on (but only a couple more times)
...
Can any help me with a code for this.
Thanks in advance - much appreciated :)
 
The code I gave you in post #2 can be easily adapted to all those scenarios.
For a range name (include the quotes around the range name)
Range("Range_Name").Copy destRng
Done! It worked. I have tried the above code with "move" (cause I need to actually move the contents over). It is like a Kan Ban type board. I need to move the items into another column once the requisition has come in etc. but "move" doesn't work. Maybe I need to cut and paste it over? Will try that. I have to admit, I love what I am learning in this process.
 
Upvote 0

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Done! It worked. I have tried the above code with "move" (cause I need to actually move the contents over). It is like a Kan Ban type board. I need to move the items into another column once the requisition has come in etc. but "move" doesn't work. Maybe I need to cut and paste it over? Will try that. I have to admit, I love what I am learning in this process.
Cut & Paste is effectively Move.
You can use the same line just swapping out Copy for Cut.
(just be carefull if there are formulas involved & it might also cause you issues with cell formatting)

VBA Code:
 Worksheets("Sheet1").Range("C6:D13").Cut destRng
 
Upvote 0

Forum statistics

Threads
1,215,650
Messages
6,126,010
Members
449,280
Latest member
Miahr

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