ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Capturing an error and then ignoring it (https://www.excelbanter.com/excel-programming/304824-capturing-error-then-ignoring.html)

cskgg

Capturing an error and then ignoring it
 
Hi everyone, here is my problem:

Can any one pls tell me the code for telling the program to:
SELECT THE FIRST SHEET OF THE WORKBOOK (irresepctive of its name - i.e
the name of the first worksheet may be anything).

Many thanks guys! This forum is cool maaan.

Warm regards
CSKG

--
Message posted from http://www.ExcelForum.com


keepITcool

Capturing an error and then ignoring it
 

Use the NUMERICAL index..

dim ws as worksheet
dim sh as object
set ws = activeworkbook.worksheets(1)
'if you have charts..
set sh-activeworkbook.sheets(1)

or if you dont need the variable..
activeworkbook.worksheets(1).activate




--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


cskgg wrote :

Hi everyone, here is my problem:

Can any one pls tell me the code for telling the program to:
SELECT THE FIRST SHEET OF THE WORKBOOK (irresepctive of its name -
i.e. the name of the first worksheet may be anything).

Many thanks guys! This forum is cool maaan.

Warm regards
CSKGG


---
Message posted from http://www.ExcelForum.com/




All times are GMT +1. The time now is 07:28 PM.

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