The sample code is here: try if it helps you!
sub Auto_Fill()
Dim row_range As Range
Dim ref_value As Variant
Dim o As Double
Set row_range = ActiveSheet.Range("A" & CStr(Application.Rows.Count)) _
.End(xlUp)
(Here I took A column, you can change as your demand)
For o = row_range.Row To 1 Step -1
If ActiveSheet.Range("A" & CStr(n)) = "" Then
ActiveSheet.Range("A" & CStr(n)) = ref_value
Else
ref_value = ActiveSheet.Range("A" & CStr(n))
End If
Next n
End Sub
NOTE: You may use a specific worksheet name. The macro works back from the last cell containing data in column A to row 1 – edit row 1 if necessary, on this line: For o = …..
Thanks–
Discuss This Question: 10  Replies