Matt Ridge
Matt Ridge

Reputation: 3651

How to fill in blank cells with correct data without overwriting the data above it

Ok, I've been trying to get this working, and I've come up with this, but it's obviously not working...

    With Application
        .ScreenUpdating = False
        .DisplayAlerts = False
        .EnableEvents = False
        .Calculation = xlCalculationManual
    End With


With wsJL
    Dim wsJL As Worksheet
    Set wsJL = Sheets("Jobs List")

        lastrow = wsJL.Cells(Rows.Count, "J").End(xlUp).Row
        fstcell = wsJL.Cells(Rows.Count, "I").End(xlUp).Row
        wsJL.Range("AA1:AD1").Copy wsJL.Range("J & fstcell:N" & lastrow)
End With

This part isn't working...

wsJL.Range("AA1:AD1").Copy wsJL.Range("J & fstcell:N" & lastrow)

I'd like to know how to make it work...I've never seen a formula used this way though my google searches so I don't even know if it's possible or not.

Thanks for helping.

Upvotes: 0

Views: 294

Answers (1)

Rob I
Rob I

Reputation: 5737

You didn't quite get me to follow the whole way, but I think you're going for something like this:

wsJL.Range("AA1:AD1").Copy wsJL.Range("J" & fstcell & ":N" & lastrow)

Note the & operator probably won't work inside your string.

Upvotes: 1

Related Questions