ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   visual basic command identify a worksheet in a workbook (https://www.excelbanter.com/excel-programming/338546-visual-basic-command-identify-worksheet-workbook.html)

F.C

visual basic command identify a worksheet in a workbook
 
A staff member produced an insert macro using visual basic editor in excel
When I attempt to insert a sheet, the macro always selects the first sheet
of a multipal book. The following command has been used.
Sheets ("Command Page").Select

How can I identify a specfic sheet in a workbook

Tom Ogilvy

visual basic command identify a worksheet in a workbook
 
perhaps

to get the last sheet as an example.

With thisworkbook
.Worksheets(.Worksheets.count).Select
End With

or you can specify a specific sheet,

Worksheets("MyNewSheet").Select

but that is what you are already doing.

--
Regards,
Tom Ogilvy

"F.C" wrote in message
...
A staff member produced an insert macro using visual basic editor in excel
When I attempt to insert a sheet, the macro always selects the first sheet
of a multipal book. The following command has been used.
Sheets ("Command Page").Select

How can I identify a specfic sheet in a workbook




F.C[_2_]

visual basic command identify a worksheet in a workbook
 
Dear Tom


I ended up doing the following

Worksheets("Export").Select

Thank you for your help

Kind Regards
Frank



"Tom Ogilvy" wrote:

perhaps

to get the last sheet as an example.

With thisworkbook
.Worksheets(.Worksheets.count).Select
End With

or you can specify a specific sheet,

Worksheets("MyNewSheet").Select

but that is what you are already doing.

--
Regards,
Tom Ogilvy

"F.C" wrote in message
...
A staff member produced an insert macro using visual basic editor in excel
When I attempt to insert a sheet, the macro always selects the first sheet
of a multipal book. The following command has been used.
Sheets ("Command Page").Select

How can I identify a specfic sheet in a workbook






All times are GMT +1. The time now is 11:17 AM.

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