Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 193
Default 20007 issue?

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
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
same issue Dink Charts and Charting in Excel 1 October 3rd 09 10:40 AM
Downloading Excel 2003 to replace 2000 and keep trail 20007 versio cb New Users to Excel 6 October 12th 07 05:08 AM
Close Excel 20007 with the last worksheet? Haloyshka Setting up and Configuration of Excel 0 October 2nd 07 02:13 PM
Yet another issue VegasBurger Excel Worksheet Functions 5 June 14th 06 10:22 PM
#VALUE! issue Pat Excel Worksheet Functions 1 November 17th 04 01:32 PM


All times are GMT +1. The time now is 11:48 PM.

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"