Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 17
Default Open a workbook, Copy several cells, then Close the previously openedworkbook

I want to open several workbooks (7 in total). Copy certain cells from
each workbook to a 8th workbook and then close the 7 workbooks that I
opened.

Joined Report.xls is created before this codes starts.

I started out with this code:

Sub Open_Says_Me()

Workbooks.Open Filename:="X:\Area1_7\DAILY_Area1_Area7.XLS"

Windows("DAILY_Area1_Area7.XLS").Activate

'Copy Info
Windows("DAILY_Area1_Area7.XLS").Activate
Range("D3").Select
Range("D3").Copy
Windows("Joined Report.xls").Activate
Range("D5").Select
ActiveSheet.Paste
Windows("DAILY_Area1_Area7.XLS").Activate
Range("E3").Select
Range("E3").Copy
Windows("Joined Report.xls").Activate
Range("F5").Select
ActiveSheet.Paste
Windows("DAILY_Area1_Area7.XLS").Activate
Range("F3").Select
Range("F3").Copy
Windows("Joined Report.xls").Activate
Range("H5").Select
ActiveSheet.Paste
Windows("DAILY_Area1_Area7.XLS").Activate
Range("D4").Select
Range("D4").Copy
Windows("Joined Report.xls").Activate
Range("D17").Select
ActiveSheet.Paste
Windows("DAILY_Area1_Area7.XLS").Activate
Range("E4").Select
Range("E4").Copy
Windows("Joined Report.xls").Activate
Range("F17").Select
ActiveSheet.Paste
Windows("DAILY_Area1_Area7.XLS").Activate
Range("F4").Select
Range("F4").Copy
Windows("Joined Report.xls").Activate
Range("H17").Select
ActiveSheet.Paste
ActiveWorkbook.Save
'Close BLV-PLV
Windows("DAILY_Area1_Area7.XLS").Activate
Workbooks("DAILY_Area1_Area7.XLS").Close SaveChanges:=False
'Workbooks.Open Filename:="X:\Area 2\DAILY_Area 2.XLS"

'Workbooks.Open Filename:="X:\Area 3\DAILY_Area 3.XLS"

'Workbooks.Open Filename:="X:\Area 4\DAILY_Area 4.XLS"

'Workbooks.Open Filename:="X:\Area 5\DAILY_Area 5.XLS"

'Workbooks.Open Filename:="X:\Area 6\DAILY_Area 6.XLS"

'Workbooks.Open Filename:="X:\Area 8\DAILY_Area 8.XLS"

End Sub

The workbook opens just fine, but will not copy. However; when I run
the macro using step into it works.

This macro is opened by another macro using the Application.Run
"Open_Says_Me"

I commented out the other 6 workbooks because I am stuck trying to get
this one to copy and close.
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
An Excel 2007 file I had previously used, will not open badger48 Excel Discussion (Misc queries) 2 July 21st 07 04:32 PM
Macro to close workbook and re-open new copy Dave Lagergren Excel Discussion (Misc queries) 2 February 28th 07 10:11 PM
How can I use open/close Grouped cells in a Protected Worksheet? Andy Bowshell Excel Discussion (Misc queries) 2 January 16th 06 02:38 PM
checking that cells have a value before the workbook will close kcdonaldson Excel Worksheet Functions 8 December 5th 05 04:57 PM
How can I close only 1 workbook when I have many open? jpt consulting Excel Discussion (Misc queries) 3 November 30th 04 11:58 PM


All times are GMT +1. The time now is 05:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"