For the future, so helpers do not have to manually type out sample data to test with:
MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here:
XL2BB Add-in
Note that there is also a "
Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
Try this with a
copy of your workbook. It is based on headers in row 2 as shown in your image.
VBA Code:
Sub Rearrange()
Dim r As Long
Application.ScreenUpdating = False
For r = Range("D" & Rows.Count).End(xlUp).Row To 3 Step -1
If Not IsEmpty(Range("D" & r).Value) Then
Rows(r).Copy
Rows(r + 1).Insert
Range("D" & r + 1).Cut Destination:=Range("C" & r + 1)
Range("D" & r).ClearContents
End If
Next r
Application.ScreenUpdating = True
End Sub