Public Sub test()
Dim i As Long
Dim StartRow As Long, EndRow As Long
Dim CheckRow As Long
Dim LastRow As Long
LastRow = 50 ' You have to find out this somehow, so instead of a hardcoded 50, this number
' should be calculated.
StartRow = 2
CheckRow = 2
Do While CheckRow < LastRow
CheckRow = Cells(StartRow, "J").End(xlDown).Row
If Cells(CheckRow, "J").Value <> "" Then
' Range end (next element) found
EndRow = CheckRow - 1
Range("J" & StartRow + 1 & ":J" & EndRow).Value = Range("J" & StartRow).Value
StartRow = CheckRow
Else
Range("J" & StartRow + 1 & ":J" & LastRow).Value = Range("J" & StartRow)
Exit Do
End If
Loop
End Sub