Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determ worksheet number based on worksheet title

Status
Not open for further replies.

jhogie

Technical User
Jun 3, 2008
24
CA
This seems like it should be simple, but I just can't figure it out. I have an excel worksheet titled "Equipment", with several worksheets before and after it. I would like to find out what worksheet number "Equipment" is.

Here is A line I've been playing with.

EquipNumSheet = ThisWorkbook.Worksheets("Equipment").Range

I appreciate any help. Thanks,

Hogie
 
I figured out a different way of doing it, and like I said it was pretty simple. I am pretty tired and couldn't get off my one line of thought.

Code:
For h = 1 To NumSheet
    If wkb.Worksheets(h).name = "Equipment" Then
        EquipNumSheet = h
    End If
Next h

Thanks for looking into it though
 
FYI: I think INDEX is what you were looking for
Code:
intEquipShtNum = Sheets("Equipment").index

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ 181-2886 before posting.
 
Thanks for the reply, I suspected there was an even simpler way of doing it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top