Copy Data from one Workbook to another

Negi1984

Board Regular
Joined
May 6, 2011
Messages
198
Hi All,

I have 2 different file and my goal is to copy data from 1 workbook from specific range and paste as value in other workbook in specific range. Normal copy paste I did by recording macro but unable to apply logic to solve with multiple conditions.

looking here for support. I have uploaded the sample file for example purpose in this link : https://1drv.ms/x/s!Ap80Ku6M2Tw5gUqvEuWR3VBUcMMG. Also highlighed ranges in yellow color which needs to copy and paste.

Conditions :-
1) In workbook 1 contains Sheet name "Table 1" from which I need to copy data.
2) WB 2 contains sheet name "Lista de Produtos_Instalar" in which I have to paste data.
3) Data Should be copy from next row as soon as cell contains "NOME" in column A.
4) Last range to copy data is one row above till column name Data as soon as cell contains "Gabinete "+Any number.
and
if there is no "Gabinete" mentioned till last row of workbook 1 than just copy data till last row. 5) Now go to Workbook to sheet name "Lista de Produtos_Instalar" and search for work contains "NOME" in column A and paste the copied data , 1 row below the "NOME".

Note : Here not more issue , we need to paste in visible cells, any rows can be hidden. Also columns in where we are pasting data having merged cells.

6) Now again we need to repeat same copy paste steps if there is another cells contains word "NOME" in column A in workbook 1 and follow above steps 3 to 5 similarly.

Not sure I am able to explain it properly but I Hope by seeing rows highlighted in yellow in above given link will easily understandable.

Regards,
Rajender
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
We need to paste in visible cells, any rows can be hidden. Also columns in where we are pasting data having merged cells.


That's a problem, if there are hidden rows, then you have to paste cell by cell.
If on the target sheet you have merged cells of different size than the source cells, you can not paste.

Do you want to copy only the data in column A or the entire row?
 
Upvote 0
That's a problem, if there are hidden rows, then you have to paste cell by cell.
If on the target sheet you have merged cells of different size than the source cells, you can not paste.

Do you want to copy only the data in column A or the entire row?

Hi Dante,

Data needs to copy from column A to Header name "DATA".
it will also ok for me to copy cell by cell. Also if in cells are merged in source sheets as well but not same no. of columns merged and Target cells where we need to paste data , can we not unmerge then paste and again Merge in same format ?

Thanks in advance for your valuable support.
 
Upvote 0
I will review your file to see what to copy and where to paste, I hope your file has those considerations with those examples, otherwise you can prepare a more real one.
 
Upvote 0
I will review your file to see what to copy and where to paste, I hope your file has those considerations with those examples, otherwise you can prepare a more real one.
Hi Dante,

Till now I have only these condition where needs to copy data (Yellow Highlighted sheet name Table 1) from Workbook 1 and paste in Workbook 2 (sheet name =Lista de Produtos_Instalar )in yellow highlighted cells.

Just one more thing want to highlight it here , if anything written in Sheet name "Lista de Produtos_Instalar" in workbook 2 than it can be over wright.
 
Upvote 0
You can upload the file with the expected result, taking into account the same data you sent in the first book.
 
Upvote 0
In the sheet "Lista de Produtos_Instalar" does the text "Cabinete 4" exist?
 
Upvote 0
Hi Dante,

Yes, if table 1 contains "Gabinete 4" or "Gabinete 5" ...... or so on , than "Lista de Produtos_Instalar" sheet also contains same names.
 
Upvote 0

Forum statistics

Threads
1,214,808
Messages
6,121,686
Members
449,048
Latest member
81jamesacct

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