Copy Data From One Workbook To a Specific Workbook

Vishaal

Well-known Member
Joined
Mar 16, 2019
Messages
533
Office Version
  1. 2010
  2. 2007
Platform
  1. Windows
  2. Web
Hi,

We have Two Workbook in same location
Workbook Name

1. Test
2. Data

now we want to copy data from Test, Sheet1!A2:A and paste in Data, Sheet1!A2:A
and we want to copy data of Test, Sheet1!B2:B and paste in Data, Sheet1!C2:C

advice pls
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
got the solution


VBA Code:
Dim mydata As String
mydata = "='D:\Backup\user\Desktop\New folder\[sourtttt1.xlsx]Sheet1'!$A$2:$A$7"
With ThisWorkbook.Sheets(1).Range("B2:B7")
    .Formula = mydata
    .Value = .Value 
   
mydata = "='D:\Backup\user\Desktop\New folder\[sourtttt1.xlsx]Sheet1'!$B$2:$B$7"
With ThisWorkbook.Sheets(1).Range("C2:C7")
    .Formula = mydata
    .Value = .Value 
   
End With

End With

End Sub
 
Upvote 0
Solution

Forum statistics

Threads
1,215,416
Messages
6,124,772
Members
449,187
Latest member
hermansoa

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