Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Counting Visible Sheets (97; SR2)

    Is it possible to count the visible (not hidden) sheets only?

    One can count all sheets by using: msgbox Sheets.Count


    Thanks,
    John

  2. #2
    3 Star Lounger
    Join Date
    May 2002
    Location
    Toronto, Ontario, Canada
    Posts
    314
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Counting Visible Sheets (97; SR2)

    Hi John... Give this a try...

    Sub GetVisibleSheetCount()
    Dim intCount As Integer
    Dim i As Integer

    intCount = 0

    For i = 1 To Sheets.Count
    If Sheets(i).Visible Then
    intCount = intCount + 1
    End If
    Next i

    End Sub


    HTH... Let me know how it goes... <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  3. #3
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Counting Visible Sheets (97; SR2)

    Trudi,

    It worked.

    Many thanks,
    John

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •