In the above method, a single-cell recording sheet will be ignored, although this may seem like a cripple, a Find looking for a non-empty cell will give more confidence.
The xlFormulas argument in the Find method will find hidden cells (but not filtered cells), while xlValues will not.
Sub FindLastSht() Dim lngCnt As Long Dim rng1 As Range Dim strSht As String With ActiveWorkbook For lngCnt = .Worksheets.Count To 1 Step -1 Set rng1 = .Sheets(lngCnt).Cells.Find("*", , xlFormulas) If Not rng1 Is Nothing Then strSht = .Sheets(lngCnt).Name Exit For End If Next lngCnt If Len(strSht) > 0 Then MsgBox "Last used sheet in " & .Name & " is " & strSht Else MsgBox "No data is contained in " & .Name End If End With End Sub
source share