• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to fill blank cells with pre-defined values

Hi @ThrottleWorks

Maybe something like this (assuming that last line "Please note output should replace original input" is not present in real scenario):
Code:
Sub test()

    Dim c As Range
    lrow = Columns("A").Cells(Rows.Count).End(xlUp).Row
 
    For Each c In Range("A3:A" & lrow)
        If IsNumeric(c) Then
            c.Offset(1, 1).Value = c.Value
        End If
    Next c
 
    For Each c In Range("B4:B" & lrow)
        If IsEmpty(c) Then
            c.Value = c.Offset(-1, 0).Value
        End If
    Next c
 
    For Each c In Range("A3:A" & lrow)
        If IsNumeric(c) Then
            c.EntireRow.Delete shift:=xlUp
        End If
    Next c
     
End Sub

Just a rough first attempt... I believe it can be "cleaned up"

Regards
 
Back
Top