I use this VBA in a macro. Excel2016.:
The debugger indicates that the red highlighted row is the problem. I can't find what is wrong with this line. The ActiveSheet has over 100 rows filled with data, including column E.
Can anyone help?
Option Explicit
Sub LastRowWithData()
Dim lastRow As Long
lastRow = ActiveSheet.Range("E" & Rows.Count).End(xlUp).Row
Range("Control!B2") = lastRow
Range("J1") = lastRow
End Sub
The debugger indicates that the red highlighted row is the problem. I can't find what is wrong with this line. The ActiveSheet has over 100 rows filled with data, including column E.
Can anyone help?