Writing data to a new workbook

  • Thread starter Thread starter Nils Titley
  • Start date Start date
N

Nils Titley

I have two workbooks that I have open. WorkBook A has data in it. WorkBook
B is blank.

If I use this code, I can get the date from WorkBook A
Range("A2").Activate
RunDate = ActiveCell.Offset(0, 1).Value
MsgBox "Run Date " & RunDate

I can not figure out how to write the RunDate to the same location in
WorkBook B.

Another question, how to open a new Workbook with a file name or save it
with a file name.

Thank you.
 
Something like...
Dim s as String
s = ActiveCell.Offset(0, 1).Address
WorkbookB.Worksheets("Sheet1").Range(s).Value = RunDate
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




"Nils Titley"
wrote in message
I have two workbooks that I have open. WorkBook A has data in it. WorkBook
B is blank.

If I use this code, I can get the date from WorkBook A
Range("A2").Activate
RunDate = ActiveCell.Offset(0, 1).Value
MsgBox "Run Date " & RunDate

I can not figure out how to write the RunDate to the same location in
WorkBook B.

Another question, how to open a new Workbook with a file name or save it
with a file name.

Thank you.
 
Jim

Thanks. That works but it places the value on the same row as the data that
I am copying and I don't want that. Plus the date is not the same as what is
in the file. The date is in A and I got time out.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top