reference worksheet by sheet number

B

bic

I'd like to achieve read ing multiple cells across the worksheets in a
workbook into an array. Can I reference worksheets by sheet number, i.e, the
first sheet #1 or the
like, the second sheet #2 or the like, etc instead of
worksheet("worksheet_name")? Thanks.
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?Ymlj?=,
I'd like to achieve read ing multiple cells across the worksheets in a
workbook into an array. Can I reference worksheets by sheet number, i.e, the
first sheet #1 or the
like, the second sheet #2 or the like, etc instead of
worksheet("worksheet_name")?
Yes, you should be able to use Sheets(1), IOW the index number of the sheet in
the Workbook.
Dim wb as Excel.Workbook

Set wb = ActiveWorkbook
Debug.Print wb.Sheets(2).Range("A1").Text

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

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

Top