Writing Cell info to a new Excel file

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

Hi, wonder if someone can help.

I need to write information from various cells in one file (not in any
particular order) to another file.

The examples I have seen do not show quite what I want and when i try to
adapt them, it doesn't work.

I can open a file but writiig the information seems to be the problem.

Can you please help?

Thanks

Steve
 
Say we have two existing files book1.xls and Book3.xls. We want to copy a
cell from someplace in book1 and paste it to somewhere in Book3. We open
both the source and destination book and do the copy/paste.

Sub Macro1()
ChDir "C:\test folder"
Workbooks.Open Filename:="C:\test folder\book1.xls"
Workbooks.Open Filename:="C:\test folder\Book3.xls"
Windows("book1.xls").Activate
Range("F4").Select
Selection.Copy
Windows("Book3.xls").Activate
Range("A20").Select
ActiveSheet.Paste
End Sub
 
Thanks Gary, works a treat.

I don't supose there is anway you can write to a file without opening it is
there?
 
Back
Top