I have a column that has a formula in each row field. The formula propagates data from another Excel spreasheet. If there is nothing in the row field, though, the row remains bl
Here's a simple way to find the last cell in a column that does not contain a formula. It will be 0 if there is no cell without a formula.
Sub Test()
Dim i As Long, tempLast As Long, lastRow As Long
tempLast = Range("A" & Rows.Count).End(xlUp).Row
For i = tempLast To 1 Step -1
If Len(Cells(i, 1)) <> 0 Then
If Not Cells(i, 1).HasFormula Then
lastRow = i
Exit For
End If
End If
Next
MsgBox lastRow
End Sub
Note that you should use "rows.count" and not 65536 as that is no longer the last row in the newer versions of Excel. Rows.count work no matter the version, or user settings. Usedrange should also be avoided since there is a weird bug where you need to refresh the usedrange or you'll get erroneous results.