Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Macro causes Excel to crash

HI

I am using the macro below to auto format some data I have in multiple
sheets, I cycle through the sheets in another macro and then call the below
macro when the sheet is activated.

This works fine but it crashed after processing about 16-18 sheets out of
30-40. It stops on a sheet and then comes up with the error 'Not enough
Memory' The sheet that it stops on is exactly the same format as the others.
Can anyone spot anything that I have done which may have caused this? I was
under the impression that it would just work its way through the sheets and
if it was low on memory would just slow down?

I am using Access 97 on a P3 128mb ram running Windows NT.

Thanks

Sub ManipulateData()

'Delete out "/" from CC ref
Columns("B:B").Replace What:="/", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False

'Delete out redundant Row
Rows("2:2").Delete Shift:=xlUp

'Sort Values based on Seq Number
Range("B2:J929").Sort Key1:=Range("B3"), Order1:=xlAscending,
Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom

'Delete out empty column
Range("A2:A65536").Delete Shift:=xlToLeft

'Copies Column headings across to accomodate extra supplier id column
Range("G2:K2").Cut Destination:=Range("H2")

'Add formulas to extra columns and autofill down
lrow = Range("A65536").End(xlUp).Row

Range("J3").Formula = "=IF(A3="""","""",$A$1)"
Range("J3").AutoFill Destination:=Range("J3:J" & lrow)

Range("K3").Formula = "=IF(A3="""","""",$A$1)"
Range("K3").AutoFill Destination:=Range("K3:K" & lrow)

'Delete out Redundant Text Rows
For t = 3 To 100
txtchck = IsNumeric(Range("A" & t).Value)
If txtchck = False Then
Rows(t & ":1000").Delete
Else
End If
Next t

'Copy and Paste Special -- Values Formula's
Range("J1:K" & lrow).Copy
Range("J1:K" & lrow).PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False

'Delete out Redundant top rows
Rows("1:2").Delete Shift:=xlUp

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Macro causes Excel to crash

My initial reaction is that Office 97 did have lots of out of memory errors.
Have you tried a newer version of office?

"Edgar Thoemmes" wrote:

HI

I am using the macro below to auto format some data I have in multiple
sheets, I cycle through the sheets in another macro and then call the below
macro when the sheet is activated.

This works fine but it crashed after processing about 16-18 sheets out of
30-40. It stops on a sheet and then comes up with the error 'Not enough
Memory' The sheet that it stops on is exactly the same format as the others.
Can anyone spot anything that I have done which may have caused this? I was
under the impression that it would just work its way through the sheets and
if it was low on memory would just slow down?

I am using Access 97 on a P3 128mb ram running Windows NT.

Thanks

Sub ManipulateData()

'Delete out "/" from CC ref
Columns("B:B").Replace What:="/", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False

'Delete out redundant Row
Rows("2:2").Delete Shift:=xlUp

'Sort Values based on Seq Number
Range("B2:J929").Sort Key1:=Range("B3"), Order1:=xlAscending,
Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom

'Delete out empty column
Range("A2:A65536").Delete Shift:=xlToLeft

'Copies Column headings across to accomodate extra supplier id column
Range("G2:K2").Cut Destination:=Range("H2")

'Add formulas to extra columns and autofill down
lrow = Range("A65536").End(xlUp).Row

Range("J3").Formula = "=IF(A3="""","""",$A$1)"
Range("J3").AutoFill Destination:=Range("J3:J" & lrow)

Range("K3").Formula = "=IF(A3="""","""",$A$1)"
Range("K3").AutoFill Destination:=Range("K3:K" & lrow)

'Delete out Redundant Text Rows
For t = 3 To 100
txtchck = IsNumeric(Range("A" & t).Value)
If txtchck = False Then
Rows(t & ":1000").Delete
Else
End If
Next t

'Copy and Paste Special -- Values Formula's
Range("J1:K" & lrow).Copy
Range("J1:K" & lrow).PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False

'Delete out Redundant top rows
Rows("1:2").Delete Shift:=xlUp

End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Macro causes Excel to crash

Hi

I have just tested it on Excel 2003 and Excel XP and am still coming up with
the same error.

Any other ideas?

Thanks

" wrote:

My initial reaction is that Office 97 did have lots of out of memory errors.
Have you tried a newer version of office?

"Edgar Thoemmes" wrote:

HI

I am using the macro below to auto format some data I have in multiple
sheets, I cycle through the sheets in another macro and then call the below
macro when the sheet is activated.

This works fine but it crashed after processing about 16-18 sheets out of
30-40. It stops on a sheet and then comes up with the error 'Not enough
Memory' The sheet that it stops on is exactly the same format as the others.
Can anyone spot anything that I have done which may have caused this? I was
under the impression that it would just work its way through the sheets and
if it was low on memory would just slow down?

I am using Access 97 on a P3 128mb ram running Windows NT.

Thanks

Sub ManipulateData()

'Delete out "/" from CC ref
Columns("B:B").Replace What:="/", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False

'Delete out redundant Row
Rows("2:2").Delete Shift:=xlUp

'Sort Values based on Seq Number
Range("B2:J929").Sort Key1:=Range("B3"), Order1:=xlAscending,
Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom

'Delete out empty column
Range("A2:A65536").Delete Shift:=xlToLeft

'Copies Column headings across to accomodate extra supplier id column
Range("G2:K2").Cut Destination:=Range("H2")

'Add formulas to extra columns and autofill down
lrow = Range("A65536").End(xlUp).Row

Range("J3").Formula = "=IF(A3="""","""",$A$1)"
Range("J3").AutoFill Destination:=Range("J3:J" & lrow)

Range("K3").Formula = "=IF(A3="""","""",$A$1)"
Range("K3").AutoFill Destination:=Range("K3:K" & lrow)

'Delete out Redundant Text Rows
For t = 3 To 100
txtchck = IsNumeric(Range("A" & t).Value)
If txtchck = False Then
Rows(t & ":1000").Delete
Else
End If
Next t

'Copy and Paste Special -- Values Formula's
Range("J1:K" & lrow).Copy
Range("J1:K" & lrow).PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False

'Delete out Redundant top rows
Rows("1:2").Delete Shift:=xlUp

End Sub

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Macro causes Excel to crash

It is always the same sheet? What is the name of the sheet? Also, can you
rearrange the order of the sheets to see if the problem follows the sheet or
if the problem is related to how many sheets it has gone through?

"Edgar Thoemmes" wrote:

Hi

I have just tested it on Excel 2003 and Excel XP and am still coming up with
the same error.

Any other ideas?

Thanks

" wrote:

My initial reaction is that Office 97 did have lots of out of memory errors.
Have you tried a newer version of office?

"Edgar Thoemmes" wrote:

HI

I am using the macro below to auto format some data I have in multiple
sheets, I cycle through the sheets in another macro and then call the below
macro when the sheet is activated.

This works fine but it crashed after processing about 16-18 sheets out of
30-40. It stops on a sheet and then comes up with the error 'Not enough
Memory' The sheet that it stops on is exactly the same format as the others.
Can anyone spot anything that I have done which may have caused this? I was
under the impression that it would just work its way through the sheets and
if it was low on memory would just slow down?

I am using Access 97 on a P3 128mb ram running Windows NT.

Thanks

Sub ManipulateData()

'Delete out "/" from CC ref
Columns("B:B").Replace What:="/", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False

'Delete out redundant Row
Rows("2:2").Delete Shift:=xlUp

'Sort Values based on Seq Number
Range("B2:J929").Sort Key1:=Range("B3"), Order1:=xlAscending,
Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom

'Delete out empty column
Range("A2:A65536").Delete Shift:=xlToLeft

'Copies Column headings across to accomodate extra supplier id column
Range("G2:K2").Cut Destination:=Range("H2")

'Add formulas to extra columns and autofill down
lrow = Range("A65536").End(xlUp).Row

Range("J3").Formula = "=IF(A3="""","""",$A$1)"
Range("J3").AutoFill Destination:=Range("J3:J" & lrow)

Range("K3").Formula = "=IF(A3="""","""",$A$1)"
Range("K3").AutoFill Destination:=Range("K3:K" & lrow)

'Delete out Redundant Text Rows
For t = 3 To 100
txtchck = IsNumeric(Range("A" & t).Value)
If txtchck = False Then
Rows(t & ":1000").Delete
Else
End If
Next t

'Copy and Paste Special -- Values Formula's
Range("J1:K" & lrow).Copy
Range("J1:K" & lrow).PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False

'Delete out Redundant top rows
Rows("1:2").Delete Shift:=xlUp

End Sub

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
Why does this macro crash? Brian Excel Discussion (Misc queries) 6 May 11th 08 08:46 PM
Excel 2007 crash when trying to add macro button to QAT Ron Excel Discussion (Misc queries) 2 August 17th 07 10:53 PM
Macro Glitch Causing Crash Danimagus Excel Discussion (Misc queries) 1 June 6th 05 06:19 PM
Excel crash when running macro Eamonn Excel Programming 4 September 22nd 04 08:05 AM
Excel Crash Seth[_3_] Excel Programming 1 October 31st 03 01:59 PM


All times are GMT +1. The time now is 08:51 AM.

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"