primaryteach
01-06-2009, 07:10 AM
Hi all,
I would like to be able to transfer some specific data from cells in one workbook (source) to another wookbook that is already opened (target). As the name/location on the harddrive of my source changes I have started my code of as:
Private Sub CommandButton3_Click()
Dim wbTgt
Dim wbSource
Application.ScreenUpdating = True
wbSource = Application.Dialogs(xlDialogOpen).Show
If wbSource = False Then Exit Sub
However, I then get stuck. My data is in different columns on different worksheets within the 'source' workbook. E.g. In the source wookbook I have a worksheet named "Reading" that I want A3:A36 copied and pasted into A3:A36 of "Reading" in the 'target' wookbook. Then C3:C36 copied and pasted from a sheet named "Writing" from the source workbook on another sheet into the target workbook, etc.
I don't know how to code this so the macro will copy from one workbook/worksheet and place it into another workbook on a specifically named worksheet, then change back to the source data to copy from another worksheet and paste again to the target workbook.
Any ideas?
Simon
Primary school teacher
I would like to be able to transfer some specific data from cells in one workbook (source) to another wookbook that is already opened (target). As the name/location on the harddrive of my source changes I have started my code of as:
Private Sub CommandButton3_Click()
Dim wbTgt
Dim wbSource
Application.ScreenUpdating = True
wbSource = Application.Dialogs(xlDialogOpen).Show
If wbSource = False Then Exit Sub
However, I then get stuck. My data is in different columns on different worksheets within the 'source' workbook. E.g. In the source wookbook I have a worksheet named "Reading" that I want A3:A36 copied and pasted into A3:A36 of "Reading" in the 'target' wookbook. Then C3:C36 copied and pasted from a sheet named "Writing" from the source workbook on another sheet into the target workbook, etc.
I don't know how to code this so the macro will copy from one workbook/worksheet and place it into another workbook on a specifically named worksheet, then change back to the source data to copy from another worksheet and paste again to the target workbook.
Any ideas?
Simon
Primary school teacher