ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Selecting last sheet in workbook (https://www.excelbanter.com/excel-programming/399950-selecting-last-sheet-workbook.html)

Carl

Selecting last sheet in workbook
 
I'm trying to select the last sheet in a workbook. I know that going to the
next sheet is this:

ActiveSheet.Next.Select

But what is the command to select the very last sheet? End and Last don't
work.

Gary''s Student

Selecting last sheet in workbook
 
Sub lastone()
Sheets(Worksheets.Count).Activate
End Sub

--
Gary''s Student - gsnu200751


"carl" wrote:

I'm trying to select the last sheet in a workbook. I know that going to the
next sheet is this:

ActiveSheet.Next.Select

But what is the command to select the very last sheet? End and Last don't
work.


joel

Selecting last sheet in workbook
 
Sheets(Sheets.Count).Select

"carl" wrote:

I'm trying to select the last sheet in a workbook. I know that going to the
next sheet is this:

ActiveSheet.Next.Select

But what is the command to select the very last sheet? End and Last don't
work.


JE McGimpsey

Selecting last sheet in workbook
 
One way:

With ActiveWorkbook.Worksheets
.Item(.Count).Select
End With


In article ,
carl wrote:

I'm trying to select the last sheet in a workbook. I know that going to the
next sheet is this:

ActiveSheet.Next.Select

But what is the command to select the very last sheet? End and Last don't
work.



All times are GMT +1. The time now is 04:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com