Question Locked

Paste Values From One Workbook To Another Using vba To Bypass The Clipboard

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hello all,

I am trying to copy one data range in one workbook, that has been assigned a name, to another data range in another workbook using a macro. Now, I have managed to do this without a problem but I keep getting messages popping up asking if I want to keep the contents of the clipboard as the macro closes the source file.
I am aware that I can use the following code to copy and paste values between the same workbook

Sheet2.Range("B1:B200").Value= Sheet1.Range("A1:A200").Value

but do not know how to apply it to copying and pasting values to multiple workbooks. Can anyone help?

2 replies

by badong200

'you have to name each of your
'workbooks uniquely, by default a workbook?s
'name is ?ThisWorkbook? you have to change
'it in the properties window ; see example below.

MyWorkbook1.Sheet2.Range("B1:B200").Value= MyWorkbook2.Sheet1.Range("A1:A200").Value

'Hope this helps you

This discussion is closed to new replies.