I have some data files that will have around 8200 rows of data but in order to reduce file size we want to delete some of the rows. Right now I have it set up so that the user can decide which rows to keep. Is there any way to speed up the loop I have that is deleting the rows?
[vba]
DtPnt = InputBox("Process every __th data point", "Set number by which to reduce data")
DtCnt = DtPnt
' Loop through selected files and add to Results workbook
For z = LBound(FileName) To UBound(FileName)
Set wkbTemp = Workbooks.Open(FileName:=FileName(z))
ActiveSheet.Move after:=Workbooks(WkbName).Sheets("SummaryData")
' grab activesheet name
WsName = ActiveSheet.Name
CntRow = ActiveSheet.Range("AA1").End(xlDown).Row
LastRow = ActiveSheet.Range("A" & CntRow).End(xlUp).Row
For x = LastRow To 10 Step -1
If DtPnt < DtCnt Then
ActiveSheet.Range("A" & x).EntireRow.Delete
DtPnt = DtPnt + 1
Else
DtPnt = 1
End If
Next x
DtPnt = 0
CntRow = 0
LastRow = 0
Next z
[/vba]