Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 69
Default Select last worksheet in workbook

Hello all,
Is there a way to simply select the last worksheet in a workbook regardless
of its name?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Select last worksheet in workbook

Define last. The right most tab? The last sheet created? ...?

--
HTH...

Jim Thomlinson


"TimT" wrote:

Hello all,
Is there a way to simply select the last worksheet in a workbook regardless
of its name?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Select last worksheet in workbook

Tim,

Try something like


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


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"TimT" wrote in message
...
Hello all,
Is there a way to simply select the last worksheet in a
workbook regardless
of its name?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 69
Default Select last worksheet in workbook

The right most tab.

"Jim Thomlinson" wrote:

Define last. The right most tab? The last sheet created? ...?

--
HTH...

Jim Thomlinson


"TimT" wrote:

Hello all,
Is there a way to simply select the last worksheet in a workbook regardless
of its name?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Select last worksheet in workbook

Chips code will do it for you...
--
HTH...

Jim Thomlinson


"TimT" wrote:

The right most tab.

"Jim Thomlinson" wrote:

Define last. The right most tab? The last sheet created? ...?

--
HTH...

Jim Thomlinson


"TimT" wrote:

Hello all,
Is there a way to simply select the last worksheet in a workbook regardless
of its name?



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 69
Default Select last worksheet in workbook

Chip thanks,
So if I wanted to find the last tab (furthest to the right) and reference
that sheet in the following line of code:

Sheets("LastTab").Name = "Tmp_PartnerContact"

....so I can change it, how would that be referenced?


"Chip Pearson" wrote:

Tim,

Try something like


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


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"TimT" wrote in message
...
Hello all,
Is there a way to simply select the last worksheet in a
workbook regardless
of its name?




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Select last worksheet in workbook

Sheets("LastTab").Name = "Tmp_PartnerContact"

Sheets(Sheets.count).Name = "Tmp_PartnerContact"

--
Regards,
Tom Ogilvy

"TimT" wrote in message
...
Chip thanks,
So if I wanted to find the last tab (furthest to the right) and reference
that sheet in the following line of code:

Sheets("LastTab").Name = "Tmp_PartnerContact"

...so I can change it, how would that be referenced?


"Chip Pearson" wrote:

Tim,

Try something like


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


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"TimT" wrote in message
...
Hello all,
Is there a way to simply select the last worksheet in a
workbook regardless
of its name?






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
select data and write results to new worksheet in same workbook CCJ Excel Discussion (Misc queries) 2 March 26th 09 10:32 PM
Using Dialog to select a Workbook, Worksheet and Range Tony Starr[_3_] Excel Programming 2 June 24th 05 07:21 AM
In Excel 2000, How do you select the whole of a worksheet (Select. Rascal Excel Discussion (Misc queries) 1 March 5th 05 12:03 AM
In Excel 2000, How do you select the whole of a worksheet (Select. Rascal Excel Discussion (Misc queries) 1 March 4th 05 11:59 PM
Select other workbook to select data in a macro. T Tromp Excel Programming 2 September 19th 03 01:43 PM


All times are GMT +1. The time now is 11:45 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"