View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
jesmin jesmin is offline
external usenet poster
 
Posts: 1
Default Saving worksheet Data only


Hi All.
I have created a workbook("one"). When I run it(with auto_open()
macro), It generates all the data in its ("Sheet1"). Now I opened
another workbook("two"). How can I just copy the data from "Sheet1" of
"one" workbook to "Sheet1" of "two" workbook.

I tried this way: I have opened "one" workbook already and "Sheet1" is
the active sheet.
-------------------------------------------------------
ThisWorkbook.Saved = False
ThisWorkbook.Worksheets("Sheet1").Copy
Workbooks.Open Filename:="C:\two.xls"
Workbooks("two.xls").Worksheets(1).Select
ActiveSheet.Paste
Workbooks("two.xls").Saved = True
ThisWorkbook.Close
-------------------------
The code is not working. What is the problem?
Thanks


--
jesmin
------------------------------------------------------------------------
jesmin's Profile: http://www.excelforum.com/member.php...o&userid=29540
View this thread: http://www.excelforum.com/showthread...hreadid=500928