Good afternoon, tek-tip folks.
I have this relatively small section of code (seen below) that takes 32.4 seconds to run. I'd like to speed it up, but I've improved it as much as I can. Can any experts out there give me some suggestions?
Part of the problem is that the raw data I'm formatting is exported from the system wacky. Every 6th row starting from row 5 contains the data that I need. The other rows are full of blank cells and spaces and other useless data. Is there a better way to do this?
Thank you for taking a look.
I have this relatively small section of code (seen below) that takes 32.4 seconds to run. I'd like to speed it up, but I've improved it as much as I can. Can any experts out there give me some suggestions?
Part of the problem is that the raw data I'm formatting is exported from the system wacky. Every 6th row starting from row 5 contains the data that I need. The other rows are full of blank cells and spaces and other useless data. Is there a better way to do this?
Code:
'This section of the code formats the raw data file
Dim RowVar As Long
'delete all unnecessary rows
Sheet.Cells(543, 1).EntireRow.Delete
For RowVar = 542 To 3 Step -1
If (539 - RowVar) Mod 6 <> 0 Then
Sheet.Cells(RowVar, 1).EntireRow.Delete
End If
Next
Thank you for taking a look.