how do you select the "last" sheet (created) in a workbook

  • Thread starter Thread starter Mark Kubicki
  • Start date Start date
M

Mark Kubicki

vs, the worksheet attached to the last visible tab displayed in the view?

thanks in advance
mark
 
One way:

Option Explicit
Sub testme04()

Dim iCtr As Long

For iCtr = Worksheets.Count To 1 Step -1
If Worksheets(iCtr).Visible = xlSheetVisible Then
Worksheets(iCtr).Select
Exit For
End If
Next iCtr
End Sub
 
Back
Top