Here is what I need help with...

I want to use VBA to determine the range of used cells on a worksheet so that I can then insert some formulas into the cells. I have used the following code to find the last row. But because I have an array formula in another sheet that references this sheet, I am getting the range as defined in the array formula.


    Dim LastRow As Long
    
    If WorksheetFunction.CountA(Cells) > 0 Then
              LastRow = Cells.Find(What:="*", After:=[A1], _
              SearchOrder:=xlByRows, _
              SearchDirection:=xlPrevious).Row
              MsgBox "Last row is: " & LastRow
    End If
Thanks,
js999