Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello Patrick,
That would be an easy answer, if I had already too many columns. But, that is not the case. Since it is part of a larger code, I will paste part of the code where it stopped. Note, after the code is stopped and several minutes later, I was able to insert a column, why? Is it doing something behind the scenes. 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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Halt Macro Execution | Excel Programming | |||
Halt or Pause a Macro | Excel Programming | |||
Halt A Macro If a Cell Contains a Certain Value | Excel Programming | |||
Halt all code while macro runs | Excel Programming | |||
Code to halt a macro | Excel Programming |