Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 84
Default Writing data to a new workbook

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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Writing data to a new workbook


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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 84
Default Writing data to a new workbook

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

"Jim Cone" wrote:


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.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 84
Default Writing data to a new workbook


My msgbox only shows the time though the date is what is there.
"Jim Cone" wrote:


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.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Writing to another workbook Eric Hearn Excel Worksheet Functions 0 March 7th 08 02:15 PM
Writing data to an excel workbook KevinB Excel Programming 2 June 13th 07 05:53 AM
Reading Writing Data from One WorkBook to Another John Pierce Excel Programming 0 May 30th 05 09:23 PM
Writing to a closed workbook Todd Huttenstine Excel Programming 0 April 30th 04 04:44 PM
Writing to 2nd worksheet in workbook steve Excel Programming 0 August 21st 03 05:26 PM


All times are GMT +1. The time now is 12:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"