If Cells are empty it should take the value of above cells but it is not working. Sample file attached
Will be greatfull for your help
Sub Macro5()
'
' Macro5 Macro
Dim NRow1 As Long 'data sheet
Dim CRow1 As Long 'current row
NRow1 = Range("C" & Rows.Count).End(xlUp).Row
Columns("A:A").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
CRow1 = 12
Cells(CRow1, "A").Select
ActiveCell.FormulaR1C1 = "=RC[1]"
CRow1 = CRow1 + 1
While NRow1 > CRow1
If IsEmpty(Cells(CRow1, "B").Value) = True Then
Cells(CRow1, "A") = (Cells(CRow1 - 1, "A"))
Else
Cells(CRow1, "A") = (Cells(CRow1, "B"))
End If
CRow1 = CRow1 + 1
Wend
Columns("A:A").Delete
End Sub
Bookmarks