Results 1 to 3 of 3
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    count sheets and cicling it (2000 sr -1)

    Hi have a wbook with sheets named LUSTAAA, LUSTBBB, ...LUST...
    i want count only all sheets named with first three letter LUST

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: count sheets and cicling it (2000 sr -1)

    LUST is a four-letter word!

    Dim lngCount As Long
    Dim wsh As Worksheet
    lngCount = 0
    ' Loop through worksheets
    For Each wsh In ActiveWorkbook.Worksheets
    ' Does the name begin with "LUST"?
    If UCase(Left(wsh.Name, 4)) = "LUST" Then
    ' If so, increase the count
    lngCount = lngCount + 1
    End If
    Next wsh
    ' lngCount now contains the count
    MsgBox lngCount & " sheets"

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: count sheets and cicling it (2000 sr -1)

    <img src=/S/crybaby.gif border=0 alt=crybaby width=15 height=15> <img src=/S/bouncenburn.gif border=0 alt=bouncenburn width=31 height=31> yes four!
    Tks for code naturally work fine!
    .

Posting Permissions

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