Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Have to keep hitting the Continue Button

Show the code.

Tim

wrote in message oups.com...
I wrote a very simple Macro and when it runs on my PC it runs with no
problem. On a coworkers PC it stops several times and I have to hit
the continue button until it eventually finishes. Any idea why this
happens or a possible solution.
Thanks.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Have to keep hitting the Continue Button

The message is "Code execution has been interrupted". The message
usually appears first at the line that reads ".WrapText = False".

Thanks for your help,
Seth


The code is...

Option Explicit
Sub Cleanup_Report()
Range("A1:J9").EntireRow.Delete
Cells.Select
With Selection
.WrapText = False
.MergeCells = False
End With

Columns("A:M").Select
Columns("A:M").EntireColumn.AutoFit
Range("C1").Select
Selection.EntireColumn.Delete
Selection.EntireColumn.Delete
Range("D1").Select
Selection.EntireColumn.Delete
Selection.EntireColumn.Delete
Range("F1:Z1").Select
Selection.EntireColumn.Delete
Selection.EntireColumn.Delete
Columns("A:E").Select
Selection.Sort Key1:=Range("D2"), Order1:=xlAscending,
Key2:=Range("C2") _
, Order2:=xlAscending, Header:=xlYes, OrderCustom:=1,
MatchCase:=False _
, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal,
DataOption2:= _
xlSortNormal
Cells.Select
Cells.EntireRow.AutoFit
Range("A1").Select
Selection.CurrentRegion.Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Range("A1").Select
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Have to keep hitting the Continue Button

The message is "Code execution has been interrupted". The message
usually appears first at the line that reads ".WrapText = False".

Thanks for your help,
Seth


The code is...

Option Explicit
Sub Cleanup_Report()
Range("A1:J9").EntireRow.Delete
Cells.Select
With Selection
.WrapText = False
.MergeCells = False
End With

Columns("A:M").Select
Columns("A:M").EntireColumn.AutoFit
Range("C1").Select
Selection.EntireColumn.Delete
Selection.EntireColumn.Delete
Range("D1").Select
Selection.EntireColumn.Delete
Selection.EntireColumn.Delete
Range("F1:Z1").Select
Selection.EntireColumn.Delete
Selection.EntireColumn.Delete
Columns("A:E").Select
Selection.Sort Key1:=Range("D2"), Order1:=xlAscending,
Key2:=Range("C2") _
, Order2:=xlAscending, Header:=xlYes, OrderCustom:=1,
MatchCase:=False _
, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal,
DataOption2:= _
xlSortNormal
Cells.Select
Cells.EntireRow.AutoFit
Range("A1").Select
Selection.CurrentRegion.Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Range("A1").Select
End Sub

Tim Williams wrote:
Show the code.

Tim

wrote in message oups.com...

I wrote a very simple Macro and when it runs on my PC it runs with no
problem. On a coworkers PC it stops several times and I have to hit
the continue button until it eventually finishes. Any idea why this
happens or a possible solution.
Thanks.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Have to keep hitting the Continue Button

You should be able to simplify your code a lot: that may help, but there is nothing obviously "wrong" here.

Tim

Sub Cleanup_Report()

With ActiveSheet
.Range("A1:A9").EntireRow.Delete

With .UsedRange
.WrapText = False
.MergeCells = False
End With

.Range("C1:D1,F1:Z1").EntireColumn.Delete 'check this!

.Columns("A:E").Sort Key1:=Range("D2"), Order1:=xlAscending, _
Key2:=Range("C2"), Order2:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal, DataOption2:=xlSortNormal

.Columns("A:M").EntireColumn.AutoFit
.UsedRange.EntireRow.AutoFit

With .Range("A1").CurrentRegion
.Borders.LineStyle = xlContinuous
.Borders.Weight = xlThin
.Borders.ColorIndex = xlAutomatic
.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
End With

End With
End Sub



"Seth Dunayer" wrote in message ...
The message is "Code execution has been interrupted". The message
usually appears first at the line that reads ".WrapText = False".

Thanks for your help,
Seth


The code is...

Option Explicit
Sub Cleanup_Report()
Range("A1:J9").EntireRow.Delete
Cells.Select
With Selection
.WrapText = False
.MergeCells = False
End With

Columns("A:M").Select
Columns("A:M").EntireColumn.AutoFit
Range("C1").Select
Selection.EntireColumn.Delete
Selection.EntireColumn.Delete
Range("D1").Select
Selection.EntireColumn.Delete
Selection.EntireColumn.Delete
Range("F1:Z1").Select
Selection.EntireColumn.Delete
Selection.EntireColumn.Delete
Columns("A:E").Select
Selection.Sort Key1:=Range("D2"), Order1:=xlAscending,
Key2:=Range("C2") _
, Order2:=xlAscending, Header:=xlYes, OrderCustom:=1,
MatchCase:=False _
, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal,
DataOption2:= _
xlSortNormal
Cells.Select
Cells.EntireRow.AutoFit
Range("A1").Select
Selection.CurrentRegion.Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Range("A1").Select
End Sub

Tim Williams wrote:
Show the code.

Tim

wrote in message oups.com...

I wrote a very simple Macro and when it runs on my PC it runs with no
problem. On a coworkers PC it stops several times and I have to hit
the continue button until it eventually finishes. Any idea why this
happens or a possible solution.
Thanks.




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Have to keep hitting the Continue Button

Thanks Tim, I'll try it.

Seth

Tim Williams wrote:

You should be able to simplify your code a lot: that may help, but there is nothing obviously "wrong" here.

Tim

Sub Cleanup_Report()

With ActiveSheet
.Range("A1:A9").EntireRow.Delete

With .UsedRange
.WrapText = False
.MergeCells = False
End With

.Range("C1:D1,F1:Z1").EntireColumn.Delete 'check this!

.Columns("A:E").Sort Key1:=Range("D2"), Order1:=xlAscending, _
Key2:=Range("C2"), Order2:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal, DataOption2:=xlSortNormal

.Columns("A:M").EntireColumn.AutoFit
.UsedRange.EntireRow.AutoFit

With .Range("A1").CurrentRegion
.Borders.LineStyle = xlContinuous
.Borders.Weight = xlThin
.Borders.ColorIndex = xlAutomatic
.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
End With

End With
End Sub



"Seth Dunayer" wrote in message ...

The message is "Code execution has been interrupted". The message
usually appears first at the line that reads ".WrapText = False".

Thanks for your help,
Seth


The code is...

Option Explicit
Sub Cleanup_Report()
Range("A1:J9").EntireRow.Delete
Cells.Select
With Selection
.WrapText = False
.MergeCells = False
End With

Columns("A:M").Select
Columns("A:M").EntireColumn.AutoFit
Range("C1").Select
Selection.EntireColumn.Delete
Selection.EntireColumn.Delete
Range("D1").Select
Selection.EntireColumn.Delete
Selection.EntireColumn.Delete
Range("F1:Z1").Select
Selection.EntireColumn.Delete
Selection.EntireColumn.Delete
Columns("A:E").Select
Selection.Sort Key1:=Range("D2"), Order1:=xlAscending,
Key2:=Range("C2") _
, Order2:=xlAscending, Header:=xlYes, OrderCustom:=1,
MatchCase:=False _
, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal,
DataOption2:= _
xlSortNormal
Cells.Select
Cells.EntireRow.AutoFit
Range("A1").Select
Selection.CurrentRegion.Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Range("A1").Select
End Sub

Tim Williams wrote:

Show the code.

Tim

wrote in message oups.com...


I wrote a very simple Macro and when it runs on my PC it runs with no
problem. On a coworkers PC it stops several times and I have to hit
the continue button until it eventually finishes. Any idea why this
happens or a possible solution.
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
value changes after hitting Tab or Enter button Jose Esteves Excel Discussion (Misc queries) 2 January 27th 10 08:59 PM
How do I update a formula automatically without hitting button F9 Duma New Users to Excel 1 March 27th 08 03:15 PM
I keep hitting F1 by mistake Rob Excel Programming 4 September 26th 05 02:22 PM
Create a button to continue old macro execution Brian Excel Discussion (Misc queries) 0 May 15th 05 10:22 PM
Pause macro, add form button to sheet, continue macro when button clicked! Flystar[_15_] Excel Programming 1 May 26th 04 09:45 AM


All times are GMT +1. The time now is 03:02 AM.

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"