Need formula

S

Sandy

My thanks to J.E. and Andrew for their responses to my
earlier post.

I also need a formula for counting the sheets between
SheetSomething through SheetSomethingElse inclusive in a
workbook containing X number of sheets.

This should be easy, but help doesn't give any good
examples.

Sandy
 
S

Sandy

Thanks! I'll give it try.

Sandy
-----Original Message-----
Sandy,

Try-

Function Countsheets(sSht1 As String, sSht2 As String)
Countsheets = Abs(Worksheets(sSht1).Index - Worksheets (sSht2).Index) + 1
End Function
'Sub test()
' MsgBox Countsheets("Sheet1", "Sheet2")
'End Sub

and in cell =Countsheets("Sheet4","Sheet1")

regards,

JohnI




.
 
A

Alan Beban

I followed this thread a bit, and am wondering if I am missing soemthing.

With ThisWorkbook
x = .Worksheets("SheetSomethingElse").Index - _
.Worksheets("SheetSomething").Index + 1
MsgBox x
End With

Alan Beban
 

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