View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 866
Default Copying a value from one workbook to another

SourceWorkbook.Sheets("Source Data Sheet").Range("C3").Copy
TargetWorkbook.Sheets("Target Data Sheet").Range("A2")

all on the same line.

Dan

"Jamie Jackson" wrote:

Hi Folks,

I can create a macro that copies a value from one cell to another, but since
this will be part of a nested routine, I'd like to figure out the most
elegant way to perform this one elementary piece. I suspect that the whole
activate select copy activate select paste thing that a macro creates
isn't the most elegant way to handle this.

Let's say I want to copy the value of:

Workbook: SourceWorkbook.xls
Worksheet: "Source Data Sheet"
Value: value of "C3"

... to ...

Workbook: "TargetWorkbook.xls"
Worksheet: "Target Data Sheet"
Target Cell: "A2"

What's an elegant, programmatic way to perform this inter-workbook value
assignment?

Thanks,
Jamie