LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default Combine Worksheets: Works Well in Test Mode, Locks when running no


When stepping thru in test mode, the macro works fine.
When activated with Shortcut key, the macro stops at line indicated by .
I can't figure out why.
I'm sure there has to be a much better way to combine up to 11 ws, but I
don't seem to find what I need in all of Ron deBruin's samples.
Am I overlooking the one magic sample?

Sub Combine_M2M_Extracts()

ActiveWorkbook.SaveAs Filename:="C:\DATA\Master.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False

Application.ScreenUpdating = False
' Application.EnableEvents = False
====================================
' Open/Activate # 1 File and Select Used Range
Workbooks.Open Filename:="C:\DATA\1.xls"
Windows("1.xls").Activate

Rows("1:1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy

' Activate Destination File, and Insert Rows
Windows("Master.xls").Activate
Rows("1:1").Select
Selection.Insert Shift:=xlDown
Windows("1.xls").Activate

' Activate #1 File and Close
Windows("1.xls").Activate
ActiveWindow.Close
=======================================
In between ========== basically repeats up to 10 times
 
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
installed sp1 and now only compatability mode works vince hummer Excel Discussion (Misc queries) 1 July 12th 08 02:09 PM
VB Works in test mode, but Stops when doing normal run. BEEJAY Excel Programming 1 September 22nd 06 07:03 PM
Macro Works but not in Debug Step mode Bob Smedley[_2_] Excel Programming 3 January 31st 06 04:28 PM
Excel 2000 Code works except in debug mode Bob Smedley Excel Programming 0 January 24th 06 01:21 AM
calc locks up after running a macro that moves sheets to a new fil shibao Excel Discussion (Misc queries) 0 November 7th 05 10:58 PM


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