SMART Auto copy-paste from one spreadsheet to another

JahSent

New Member
Joined
Dec 15, 2014
Messages
1
Hello.

First of all thank you that you are willing to help. This is much appreciated!

I am new to Excel (but I know how to apply macros) so please excuse the fact that I don't express my mind with a proper technical terminalogy.

English isn't my native language. Hopefully you will understand what I am trying to achieve. I will explain it as detailed as possible but please ask me if in doubt.

I have 2 excel spreadsheets. LabData.xls and Review.xls

I want to copy cells from LabData.xls selection is: D1 to CI1 ; D2 to CI2 ; D3 to CI3 => $D$1:$CI$3 => Selection contains 3rows and 84 columns.

And paste it accordingly to Review.xls B5 cell which will fill everything from B5 to CG5 ; B6 to CG6 ; B7 to CG7 => $B$5:$CG$7 The same number of cells, same order - 84 columns x 3 rows.

The paste point is to be changed upon Date variaty. I want the copy selection cells be always the same $D$1:$CI$3 LabData.xls but paste point is different. B5, B9, B13 etc B(X+4) Review.xls depending on Date:

In LabData.xls I have a cell which indicates the Date of report data = LabData.xls cell B4. In Review.xls I have a coresponding date cell which is either A4,A8,A12 etc A(X+4)

Lets say that 1st of December is A4 (just for example), 2nd of December is A8, 3rd = A12 etc in Review.xls. If LabData.xls B4 cell is indicating 1st of December then Paste the selection to B5 of Review.xls. If LabData.xls B4 cell is 2nd of December then Paste it to B9 of Review.xls.

Basically I want the macro to compare LabData.xls B4 cell with A4,A8,A12,A16,A(X+4) cells of Review.xls and if Date in B4 cell of LabData.xls is equal to one of A(X+4) cells in Review.xls then paste it accordingly to B5, B9, B13 etc.

For example in LabData.xls B4 cell is 4th of December (which is equal to A16 Review.xls), then copy $D$1:$CI$3 LabData.xls and paste it to B17 Review.xls which will fill all cells $B$17:$CG$20 because B4 LabData.xls = A16 Review.xls

If cell B4 LabData.xls is equal to cell A80 Review.xls then copy $D$1:$CI$3 LabData.xls and paste it to cell B81 Review.xls ($B$81:$CG$84)

If cell B4 LabData.xls is equal to A224 Review.xls then copy $D$1:$CI$3 LabData.xls and paste it to B225 Review.xls ($B$225:$CG$228)

Dates in Review.xls aren't constants. One day cell A4 Review.xls can be 1st of December, the other day it can be 4th of July. Macro should understand it.

BIG THANKS IN ADVANCE!
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Forum statistics

Threads
1,223,247
Messages
6,171,007
Members
452,374
Latest member
keccles

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