selecting worksheet by its index.

  • Thread starter Thread starter ucanalways
  • Start date Start date
U

ucanalways

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
 
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.
 
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
(e-mail address removed)






- 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
 
You can just delete the sheet directly by using "Sheets(1).Delete" or
"Sheet1.Delete"



HTH,
JP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top