Try this......
Option Explicit
Sub FillBlankCells()
Dim i As Long, j As Long, lr As Long, lc As Long
lr = Cells(Rows.Count, "P").End(xlUp).Row
lc = Cells(1, Columns.Count).End(xlToLeft).Column
Application.ScreenUpdating = False
For i = 2 To lr
For j = 18 To lc - 1
If Cells(i, j) = "" Then
Cells(i, j) = Cells(i, j - 1)
End If
Next j
Next i
Application.ScreenUpdating = True
End Sub
Please find the attached workbook and click on the Blue Button on the Test Sheet to run the macro. The code is present on Module1.
Bookmarks