Sorry, I posted too quickly. Here is the improvement:-
Code:
Private Sub test()
Debug.Print SheetIsEmpty(ActiveSheet)
End Sub
Private Function SheetIsEmpty(ByRef Ws As Worksheet) As Boolean
Dim Rng As Range
Dim Fi As Range
With Ws
Set Rng = Range(.Cells(1, 1), .Cells(.Rows.Count, .Columns.Count))
Set Fi = Rng.Cells.Find("*", SearchOrder:=xlByColumns, LookIn:=xlValues, _
SearchDirection:=xlPrevious)
End With
SheetIsEmpty = (Fi Is Nothing)
End Function
In fact, the first post also works, but it doesn't use the Range first created.
Rng.Cells.Find will look in the range you set.
Ws.Cells.Find will look in the entire worksheet.
Since this is what you want, you don't need the range and you can shorten the code thus:
Code:
Private Function SheetIsEmpty(ByRef Ws As Worksheet) As Boolean
Dim Fi As Range
Set Fi = Ws.Cells.Find("*", SearchOrder:=xlByColumns, LookIn:=xlValues, _
SearchDirection:=xlPrevious)
SheetIsEmpty = (Fi Is Nothing)
End Function