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

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
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,214,992
Messages
6,122,631
Members
449,095
Latest member
bsb1122

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