Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Macro halt - Why?

Hi Patrick,

I am following up on the email that I sent you. Have you any luck?

Thanks,

"Patrick Molloy" wrote:

sure



"MrRJ" wrote:

Patrick,
I have inserted screenupdating and calculationmanual to the code and it
still does not work. Please help? Can I send the code to you via email?


"Patrick Molloy" wrote:

hmmm I ran the code x1000 in a loop, and it worked fine.

so try
Application.ScreenUpdating=False

at the start of the code and

Application.ScreenUpdating=True

at the and and also switch calculation mode to manual.

"MrRJ" wrote:

Patrick,
I wish that was the answer. Here is part of my code where it stopped at.
Please note, that after I stopped the code and several minutes later, I was
able to insert the column. WHY?

Private Sub FORMAT()
' This macro formats the file to be used to upload to CCDS

Columns("BA:BA").Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Delete shift:=xlToLeft
Range("A1").Select

Columns("P:Q").Select
Selection.Delete shift:=xlToLeft

Columns("D:D").Select 'new change
Selection.Copy
Columns("AO:AO").Select
ActiveSheet.Paste
Range("A1").Select

Range("A1").Select
Columns("I:I").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Columns("A:H").Select
Application.CutCopyMode = False
Selection.Delete shift:=xlToLeft

Columns("A:A").Select
Selection.Insert shift:=xlToRight <========here is where it stopped.
Columns("F:F").Select
Selection.Cut
Columns("B:B").Select
Selection.Insert shift:=xlToRight


"Patrick Molloy" wrote:

without seeing the code, its hard to say what the issue is.

As you are inserting a column...it could be that you already have as many
columns as Excel allows?

Patrick

"MrRJ" wrote:

Good morning,

I have a pretty large macro and when I run it, it comes to a halt, with an
error of non blank cells (it stops on a line where I am inserting a column).
I had to stop the code, then I manually tried to insert a column, and it
didn't work.

NOW, after a several minutes later, I tried to insert the column and IT
WORKS! Why is that? It makes no sense to me. Is it working behind the
scenes?

I hear a lot about screenupdating and calculation turning off. Would that
help? I do not have them in my code. If you think I need it, where should I
put them?

Thanks.

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
Halt Macro Execution PeteN Excel Programming 9 July 12th 07 01:45 PM
Halt or Pause a Macro Tomkat743 Excel Programming 4 April 21st 06 07:24 PM
Halt A Macro If a Cell Contains a Certain Value John[_110_] Excel Programming 5 October 28th 05 08:50 PM
Halt all code while macro runs TimT Excel Programming 1 October 12th 05 04:51 PM
Code to halt a macro floss Excel Programming 1 April 26th 04 08:22 PM


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