Working with arrays is either one of the fastest or the fastest method of dealing with large ranges of cells.
Start with:
Run code:
Option Explicit
Sub delBlanks()
Dim i As Long, j As Long, k As Long, arr As Variant, vals As Variant
Dim s As Double, e As Double, c As Long
s = Timer
With Worksheets("sheet6")
If .AutoFilterMode Then .AutoFilterMode = False
'data validity check
c = Application.CountA(.Columns(1))
For j = 2 To 5
If c <> Application.CountA(.Columns(j)) Then Exit For
Next j
If j <= 5 Then
Debug.Print "GIGO, waste of time to continue"
Exit Sub
End If
'collect offset values
vals = .Range(.Cells(2, "A"), .Cells(.Rows.Count, "E").End(xlUp)).Value2
ReDim arr(LBound(vals, 1) To UBound(vals, 1), _
LBound(vals, 2) To UBound(vals, 2))
'loop through array coolating A"E to a single row
i = LBound(vals, 1)
k = LBound(arr, 1)
Do
For j = LBound(vals, 2) To UBound(vals, 2)
Do While vals(i, j) = vbNullString: i = i + 1: Loop
arr(k, j) = vals(i, j)
Next j
i = i + 1: k = k + 1
Loop Until i > UBound(vals, 1)
'put data back on worksheet
.Cells(2, "A").Resize(UBound(arr, 1), UBound(arr, 2)) = arr
.Cells(2, "C").Resize(UBound(arr, 1), 1).NumberFormat = "dd/mm/yyyy"
End With
e = Timer
Debug.Print c - 1 & " records in " & UBound(vals, 1) & _
" rows collated in " & Format((e - s), "0.000") & " seconds"
End Sub
Results:
30000 records in 157500 rows collated in 0.984 seconds
Seeded data:
The following was used to replicate the OP 'sample-data-in-an-image'.
Sub fillBlanks()
Dim i As Long, j As Long, k As Long, arr As Variant, vals As Variant
vals = Array("to: ""someone"" <[email protected]", "from: ""no one"" <[email protected]", _
Date, "\i\m\p\o\r\t\a\n\c\e\: 0", "subject: something nothing")
ReDim arr(1 To 6, 1 To 5)
With Worksheets("sheet6")
.Cells(1, 1).CurrentRegion.Offset(1, 0).Clear
For k = 1 To 30000
j = 0
For i = LBound(arr, 2) To UBound(arr, 2)
If i = 2 And Not CBool(k Mod 4) Then j = j + 1
If i = 4 Then
arr(i + j, i) = Format(k, vals(i - 1))
Else
arr(i + j, i) = vals(i - 1)
End If
Next i
.Cells(.Rows.Count, 5).End(xlUp).Offset(1, -4).Resize(UBound(arr, 1), UBound(arr, 2)) = arr
ReDim arr(1 To 6, 1 To 5)
Next k
End With
End Sub