VBA: Getting run-time 1004: Method 'Range' of object '_Worksheet' failed when using cells
I have 2 worksheets: Assets and Overview. The functions are all put in a module. Public Function GetLastNonEmptyCellOnWorkSheet(Ws As Worksheet, Optional sName As String = "A1") As Range Dim lLastRow As Long Dim lLastCol As Long Dim rngStartCell As Range Set rngStartCell = Ws.Range(sName) lLastRow = Ws.Cells.Find(What:="*", After:=Ws.Range(rngStartCell), LookIn:=xlFormulas, _ Lookat:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlPrevious, _ MatchCase:=False).Row lLastCol = Ws.Cells.Find(What:="*", After:=Ws.Range(rngStartCell), LookIn:=xlFormulas, _ Lookat:=xlPart, SearchOrder:=xlByColumns