Need formula

  • Thread starter Thread starter Sandy
  • Start date Start date
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
 
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




.
 
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
 
Back
Top