Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default copy a range from another workbook

i want to copy a range ("A:L") in another workbook.
C:\Workbooks\Data.xls

into my active workbook
i do not want the user to see the workbook "data" when it is open. i did
screenupdating = false on the active workbook, but "Data" still gets shown.
i am sure this is a simple statement, but i do not know everything about
VBA.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,173
Default copy a range from another workbook

Spencer

Hide your 'data.xls' through the user interface first and then save it.
Then you can use code similar to below. (I have used 'False' in the open to
stop it being added to the MRU list...not sure it would anyway, but just in
case) and cleared the clipboard or with two whole columns copied it will ask
is you wish to save it.

Sub GetData()
Dim wbExt As Workbook
Set wbExt = Workbooks.Open("C:\Workbooks\Data.xls", _
, , , , , , , , , , , False)
wbExt.Worksheets("Sheet1").Range("A:L").Copy
'do what you want here
Application.CutCopyMode = False
wbExt.Close SaveChanges:=False
Set wbExt = Nothing
End Sub

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"Spencer Hutton" wrote in message
...
i want to copy a range ("A:L") in another workbook.
C:\Workbooks\Data.xls

into my active workbook
i do not want the user to see the workbook "data" when it is open. i did
screenupdating = false on the active workbook, but "Data" still gets
shown.
i am sure this is a simple statement, but i do not know everything about
VBA.




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
copy range from one workbook to other in C# asp newbie Excel Worksheet Functions 0 May 17th 06 06:44 AM
How to copy a range to a closed workbook max Excel Programming 1 July 16th 04 11:13 AM
Need a macro to copy a range in one workbook and paste into another workbook Paul Excel Programming 8 July 1st 04 07:42 AM
Copy a range of cells in an unopened workbook and paste it to the current workbook topstar Excel Programming 3 June 24th 04 12:50 PM
Copy Range to new workbook mmasters Excel Programming 1 September 12th 03 12:31 PM


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