View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_3_] Dave Peterson[_3_] is offline
external usenet poster
 
Posts: 2,824
Default how do you select the "last" sheet (created) in a workbook

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

Mark Kubicki wrote:

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

thanks in advance
mark


--

Dave Peterson