Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy a range of cells in an unopened workbook and paste it to the current workbook

Help!

Can someone please help me with a macro to copy a range of cells fro
one unopened workbook, and paste it into the current sheet of a ne
opened workbook.

Thank

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Copy a range of cells in an unopened workbook and paste it to the current workbook

Hi

Why not open the workbook?
http://www.rondebruin.nl/copy3.htm

Or try this with a closed workbook
http://www.rondebruin.nl/ado.htm


--
Regards Ron de Bruin
http://www.rondebruin.nl


"topstar " wrote in message ...
Help!

Can someone please help me with a macro to copy a range of cells from
one unopened workbook, and paste it into the current sheet of a new
opened workbook.

Thanks


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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy a range of cells in an unopened workbook and paste it to the current workbook

Hi Ron,

Thanks very much. I cut pasted the code from the snippet below, whic
you suggested. However, the macro gives the following error


Compile Error: Sub or Function not defined

at the line GetData

Any advise?

Cheers

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






Copy a range from a closed Workbook (filename in the code)

This example will not copy the Header row (the last argument = False)
Change it to True if you want to copy the header row also.
This example will copy the range from the file test.xls that is in th
same folder

Sub GetData_Example1()
'This Copy the range to the ActiveCell
GetData ThisWorkbook.Path & "\test.xls", "Sheet1", "A1:C5"
ActiveCell, False

'This Copy the range to the Sheet/Range you want
'GetData ThisWorkbook.Path & "\test.xls", "Sheet1", "A1:C5"
Sheets("Sheet2").Range("A1"), False

End Su

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Copy a range of cells in an unopened workbook and paste it to the current workbook

Did you copy the functions also in the module?

--
Regards Ron de Bruin
http://www.rondebruin.nl


"topstar " wrote in message ...
Hi Ron,

Thanks very much. I cut pasted the code from the snippet below, which
you suggested. However, the macro gives the following error


Compile Error: Sub or Function not defined

at the line GetData

Any advise?

Cheers

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






Copy a range from a closed Workbook (filename in the code)

This example will not copy the Header row (the last argument = False)
Change it to True if you want to copy the header row also.
This example will copy the range from the file test.xls that is in the
same folder

Sub GetData_Example1()
'This Copy the range to the ActiveCell
GetData ThisWorkbook.Path & "\test.xls", "Sheet1", "A1:C5",
ActiveCell, False

'This Copy the range to the Sheet/Range you want
'GetData ThisWorkbook.Path & "\test.xls", "Sheet1", "A1:C5",
Sheets("Sheet2").Range("A1"), False

End Sub


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



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
How to copy a range of cells and paste into a new workbook in differentcolumns Mas[_4_] Excel Discussion (Misc queries) 3 August 16th 11 02:57 PM
Copy workbook to 2nd workbook paste is greyed out elmer Excel Worksheet Functions 2 January 28th 09 06:06 PM
copy and paste using code from workbook to workbook bigdaddy3 Excel Discussion (Misc queries) 2 September 14th 05 11:06 AM
Importing Data from unopened Workbook into an open Workbook GrayesGhost Excel Discussion (Misc queries) 0 March 5th 05 11:25 PM
copy range of cells from one workbook to another mitmeez Excel Discussion (Misc queries) 1 December 9th 04 08:14 PM


All times are GMT +1. The time now is 09:47 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"