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: 3
Default Excel memory leak?

I've written the following code to compare one list to a second, if
the entry in list 1 does not exist in list 2 it is deleted from list
1.

The results are not correct when it is run, some are deleted that
should be and some are missed. I am relatively sure this code is
correct, when I step through it seems to run correctly. Only when the
script is run it seems to miss things.

Is a memory leak causing this problem?

--

Sub Extract()

Dim i As Integer
Dim wbSummary As Worksheet
Dim wbCurrent As Worksheet
Dim number As Integer
Dim surname As String
Dim r As Integer
Dim d As Boolean

Set wbSummary = Worksheets("Summary")


Application.ScreenUpdating = False

i = 4
For i = 4 To 2479

number = wbSummary.Cells(i, 4)
surname = UCase(wbSummary.Cells(i, 2))
Select Case wbSummary.Cells(i, 5)
Case Is = "A"
Set wbCurrent = Worksheets("TT")
Case Is = "B"
Set wbCurrent = Worksheets("TT")
Case Is = "C"
Set wbCurrent = Worksheets("DD")
Case Is = "D"
Set wbCurrent = Worksheets("DD")
Case Is = "E"
Set wbCurrent = Worksheets("AA")
Case Is = "F"
Set wbCurrent = Worksheets("AA")
End Select

r = 4
For r = 4 To 3441
If wbCurrent.Cells(r, 6).Value = number Then
If UCase(wbCurrent.Cells(r, 4)) = surname Then
d = True
Exit For
Else
d = False
End If
Else
d = False

End If
Next
If d = False Then
wbSummary.Rows(i).Delete
Else

End If

Next

End Sub

 
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
Excel 2007 Charts & Memory Leak?? Denis[_4_] Excel Worksheet Functions 0 April 20th 11 04:32 PM
Memory Leak in Excel ofra Excel Discussion (Misc queries) 0 August 28th 05 02:20 PM
Memory Leak Excel 2003 vs 2000 using linked pictures Scriptick Excel Programming 0 April 27th 05 04:16 PM
Excel 2003 Memory Leak Amateur Excel Hack Excel Programming 0 February 8th 05 11:01 PM
Memory Leak in C++ Excel RTD (same as in VCRTDServer) Robert Newell Excel Programming 1 November 16th 04 01:06 AM


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