PC Review


Reply
Thread Tools Rate Thread

20007 issue?

 
 
Pete
Guest
Posts: n/a
 
      28th May 2009
I have used the code below to delete 29 of every 30 rows of data in a very
large data base of plant parameters. Each row represents one second of the
day (actually 27 hours of data logging i.e. 100,000 rows of data). This code
worked well in 2003 with 65,000+ rows but not so well in 2007.

The macro "breaks" after the line "... EntireRow.Delete". I can choose to
continue, end, or debug. If I use "select" instead of delete, the marco runs
fine.


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Option Explicit

Sub Delete_rows()

Dim h As Long 'used as a fixed count in j loop
Dim i As Long 'counts number of total rows in spreadsheet
Dim k As Integer 'number of rows to be deleted
Dim m As Integer 'number of rows plus one to skip over when deleting

h = 0
i = 0
k = 29
m = 0 'leaves one row undeleted when m = 0

Application.ScreenUpdating = False

For i = 3 To 100000 'Number of rows in data sheet excludes headers
h = i + k - 1
Range("A" & i & ":" & "A" & h).EntireRow.Delete
i = i + m 'Leaves m+1 rows undeleted
Next

Application.ScreenUpdating = True
MsgBox "Progam Finished - Rows have beed deleted"

End Sub

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


I think this may be a bug in 2007 Excel VBA. Any thoughts would be
appreciated.

Pete
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing a SharePoint page into PowerPoint 20007 Clifton Ivey Microsoft Powerpoint 0 14th Nov 2009 09:56 PM
Access 20007 printing Vincent Raj Microsoft Access Reports 1 9th Oct 2008 05:53 PM
Name display, Contacts Outlook 20007 Dave Horne Microsoft Outlook 1 2nd Nov 2007 11:47 PM
Close Excel 20007 with the last worksheet? =?Utf-8?B?SGFsb3lzaGth?= Microsoft Excel Setup 0 2nd Oct 2007 02:13 PM
Outlook 20007 crashes on startup =?Utf-8?B?UHJlc3NtYW40Mw==?= Microsoft Outlook Discussion 2 22nd Jul 2007 08:34 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:30 PM.