View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
phreud[_9_] phreud[_9_] is offline
external usenet poster
 
Posts: 1
Default Copying and pasting entire workbook

Hi,

I'm trying to write a load function which loads a workbook, copies it
contents, closes it and pastes the copied information into the workboo
that was open all the time (replacing what is already in there).
can't figure out how to do it. I really don't want to copy/paste i
sheet by sheet.


This is what I have:


Code
-------------------

Dim sFname As String

sFname = Application.GetOpenFilename( _
FileFilter:="Excel Workbooks,*.xls", _
Title:="Open a File", _
MultiSelect:=False)

If sFname < "False" Then
Workbooks.Open sFname

Workbooks(2).Worksheets.Copy
Workbooks(2).Close False

' This is what I would like to be able to do.
Workbooks(1).Worksheets.Paste
End If

-------------------


Any ideas?

Thanks in advance

--
Message posted from http://www.ExcelForum.com