Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 115
Default selecting worksheet by its index.

Initially I have Sheet1(Sheet3). Later I rename the Sheet 3. Let's
assume it becomes Sheet1(AAA). The name changes periodically. So, I
would like to select it using the sheet's index. What would be the
macro/syntax for this? Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 735
Default selecting worksheet by its index.

Sheets(1).Activate

However this relates to the first sheet in the workbook, change it's
position and index number changes. Consider using the codename which can be
set in the VBA Editor.

--

Regards,
Nigel




wrote in message
ups.com...
Initially I have Sheet1(Sheet3). Later I rename the Sheet 3. Let's
assume it becomes Sheet1(AAA). The name changes periodically. So, I
would like to select it using the sheet's index. What would be the
macro/syntax for this? Thanks


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 115
Default selecting worksheet by its index.

On Nov 13, 10:54 am, "Nigel" wrote:
Sheets(1).Activate

However this relates to the first sheet in the workbook, change it's
position and index number changes. Consider using the codename which can be
set in the VBA Editor.

--

Regards,
Nigel


wrote in message

ups.com...



Initially I have Sheet1(Sheet3). Later I rename the Sheet 3. Let's
assume it becomes Sheet1(AAA). The name changes periodically. So, I
would like to select it using the sheet's index. What would be the
macro/syntax for this? Thanks- Hide quoted text -


- Show quoted text -


Hi.. could you please let me know how to tackle this problem using
something in the lines of

dim wsindex as integer
if wsindex = 1 then
'activate that sheet
end if

Thanks

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 168
Default selecting worksheet by its index.

You can just delete the sheet directly by using "Sheets(1).Delete" or
"Sheet1.Delete"



HTH,
JP

On Nov 13, 2:46 pm, wrote:


Hi.. could you please let me know how to tackle this problem using
something in the lines of

dim wsindex as integer
if wsindex = 1 then
'activate that sheet
end if

Thanks


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
Selecting only from index for combobox SupperDuck Excel Programming 2 July 6th 07 08:36 PM
Index and named ranges selecting difficulty Bruce Tharp Excel Worksheet Functions 7 June 19th 07 02:49 AM
Selecting chartobject without index no. Jaylin Charts and Charting in Excel 4 August 24th 06 04:31 PM
Selecting Sheet1 by index rather than sheet name Rich J[_2_] Excel Programming 2 September 23rd 04 06:55 PM
Selecting a cell from an index Canuck[_2_] Excel Programming 1 May 16th 04 09:07 PM


All times are GMT +1. The time now is 08:38 PM.

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

About Us

"It's about Microsoft Excel"