+ Reply to Thread
Results 1 to 18 of 18

need help, want to remove some sheets

  1. #1
    Registered User
    Join Date
    08-05-2005
    Posts
    16

    need help, want to remove some sheets

    Hi, I have some sheets that starts with the same substring and I want all of them to be removed is there a simpel solution to this?

    e.g
    Thisworkbook.sheets("name-yyyy").delete exact match
    The year differs so would like to remove all sheets that starts with:
    Thisworkbook.sheets("name-").delete (multi delete if poss)

  2. #2
    Bob Phillips
    Guest

    Re: need help, want to remove some sheets

    For Each sh In ThisWorkbook.Worksheets
    If Left(sh.Name,5) = "name-" Then
    if ThisWorkbook.Sheets.Count <> 0 Then
    Application.DisplayAlerts = false
    sh.delete
    Application.DisplayAlerts = True
    End If
    End If
    Next sh

    --
    HTH

    Bob Phillips

    "Newbie80" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi, I have some sheets that starts with the same substring and I want
    > all of them to be removed is there a simpel solution to this?
    >
    > e.g
    > Thisworkbook.sheets("name-yyyy").delete exact match
    > The year differs so would like to remove all sheets that starts with:
    > Thisworkbook.sheets("name-").delete (multi delete if poss)
    >
    >
    > --
    > Newbie80
    > ------------------------------------------------------------------------
    > Newbie80's Profile:

    http://www.excelforum.com/member.php...o&userid=25946
    > View this thread: http://www.excelforum.com/showthread...hreadid=393860
    >




  3. #3
    Bob Phillips
    Guest

    Re: need help, want to remove some sheets

    For Each sh In ThisWorkbook.Worksheets
    If Left(sh.Name,5) = "name-" Then
    if ThisWorkbook.Sheets.Count <> 0 Then
    Application.DisplayAlerts = false
    sh.delete
    Application.DisplayAlerts = True
    End If
    End If
    Next sh

    --
    HTH

    Bob Phillips

    "Newbie80" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi, I have some sheets that starts with the same substring and I want
    > all of them to be removed is there a simpel solution to this?
    >
    > e.g
    > Thisworkbook.sheets("name-yyyy").delete exact match
    > The year differs so would like to remove all sheets that starts with:
    > Thisworkbook.sheets("name-").delete (multi delete if poss)
    >
    >
    > --
    > Newbie80
    > ------------------------------------------------------------------------
    > Newbie80's Profile:

    http://www.excelforum.com/member.php...o&userid=25946
    > View this thread: http://www.excelforum.com/showthread...hreadid=393860
    >




  4. #4
    Bob Phillips
    Guest

    Re: need help, want to remove some sheets

    For Each sh In ThisWorkbook.Worksheets
    If Left(sh.Name,5) = "name-" Then
    if ThisWorkbook.Sheets.Count <> 0 Then
    Application.DisplayAlerts = false
    sh.delete
    Application.DisplayAlerts = True
    End If
    End If
    Next sh

    --
    HTH

    Bob Phillips

    "Newbie80" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi, I have some sheets that starts with the same substring and I want
    > all of them to be removed is there a simpel solution to this?
    >
    > e.g
    > Thisworkbook.sheets("name-yyyy").delete exact match
    > The year differs so would like to remove all sheets that starts with:
    > Thisworkbook.sheets("name-").delete (multi delete if poss)
    >
    >
    > --
    > Newbie80
    > ------------------------------------------------------------------------
    > Newbie80's Profile:

    http://www.excelforum.com/member.php...o&userid=25946
    > View this thread: http://www.excelforum.com/showthread...hreadid=393860
    >




  5. #5
    Bob Phillips
    Guest

    Re: need help, want to remove some sheets

    For Each sh In ThisWorkbook.Worksheets
    If Left(sh.Name,5) = "name-" Then
    if ThisWorkbook.Sheets.Count <> 0 Then
    Application.DisplayAlerts = false
    sh.delete
    Application.DisplayAlerts = True
    End If
    End If
    Next sh

    --
    HTH

    Bob Phillips

    "Newbie80" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi, I have some sheets that starts with the same substring and I want
    > all of them to be removed is there a simpel solution to this?
    >
    > e.g
    > Thisworkbook.sheets("name-yyyy").delete exact match
    > The year differs so would like to remove all sheets that starts with:
    > Thisworkbook.sheets("name-").delete (multi delete if poss)
    >
    >
    > --
    > Newbie80
    > ------------------------------------------------------------------------
    > Newbie80's Profile:

    http://www.excelforum.com/member.php...o&userid=25946
    > View this thread: http://www.excelforum.com/showthread...hreadid=393860
    >




  6. #6
    Bob Phillips
    Guest

    Re: need help, want to remove some sheets

    For Each sh In ThisWorkbook.Worksheets
    If Left(sh.Name,5) = "name-" Then
    if ThisWorkbook.Sheets.Count <> 0 Then
    Application.DisplayAlerts = false
    sh.delete
    Application.DisplayAlerts = True
    End If
    End If
    Next sh

    --
    HTH

    Bob Phillips

    "Newbie80" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi, I have some sheets that starts with the same substring and I want
    > all of them to be removed is there a simpel solution to this?
    >
    > e.g
    > Thisworkbook.sheets("name-yyyy").delete exact match
    > The year differs so would like to remove all sheets that starts with:
    > Thisworkbook.sheets("name-").delete (multi delete if poss)
    >
    >
    > --
    > Newbie80
    > ------------------------------------------------------------------------
    > Newbie80's Profile:

    http://www.excelforum.com/member.php...o&userid=25946
    > View this thread: http://www.excelforum.com/showthread...hreadid=393860
    >




  7. #7
    Bob Phillips
    Guest

    Re: need help, want to remove some sheets

    For Each sh In ThisWorkbook.Worksheets
    If Left(sh.Name,5) = "name-" Then
    if ThisWorkbook.Sheets.Count <> 0 Then
    Application.DisplayAlerts = false
    sh.delete
    Application.DisplayAlerts = True
    End If
    End If
    Next sh

    --
    HTH

    Bob Phillips

    "Newbie80" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi, I have some sheets that starts with the same substring and I want
    > all of them to be removed is there a simpel solution to this?
    >
    > e.g
    > Thisworkbook.sheets("name-yyyy").delete exact match
    > The year differs so would like to remove all sheets that starts with:
    > Thisworkbook.sheets("name-").delete (multi delete if poss)
    >
    >
    > --
    > Newbie80
    > ------------------------------------------------------------------------
    > Newbie80's Profile:

    http://www.excelforum.com/member.php...o&userid=25946
    > View this thread: http://www.excelforum.com/showthread...hreadid=393860
    >




  8. #8
    Bob Phillips
    Guest

    Re: need help, want to remove some sheets

    For Each sh In ThisWorkbook.Worksheets
    If Left(sh.Name,5) = "name-" Then
    if ThisWorkbook.Sheets.Count <> 0 Then
    Application.DisplayAlerts = false
    sh.delete
    Application.DisplayAlerts = True
    End If
    End If
    Next sh

    --
    HTH

    Bob Phillips

    "Newbie80" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi, I have some sheets that starts with the same substring and I want
    > all of them to be removed is there a simpel solution to this?
    >
    > e.g
    > Thisworkbook.sheets("name-yyyy").delete exact match
    > The year differs so would like to remove all sheets that starts with:
    > Thisworkbook.sheets("name-").delete (multi delete if poss)
    >
    >
    > --
    > Newbie80
    > ------------------------------------------------------------------------
    > Newbie80's Profile:

    http://www.excelforum.com/member.php...o&userid=25946
    > View this thread: http://www.excelforum.com/showthread...hreadid=393860
    >




  9. #9
    Bob Phillips
    Guest

    Re: need help, want to remove some sheets

    For Each sh In ThisWorkbook.Worksheets
    If Left(sh.Name,5) = "name-" Then
    if ThisWorkbook.Sheets.Count <> 0 Then
    Application.DisplayAlerts = false
    sh.delete
    Application.DisplayAlerts = True
    End If
    End If
    Next sh

    --
    HTH

    Bob Phillips

    "Newbie80" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi, I have some sheets that starts with the same substring and I want
    > all of them to be removed is there a simpel solution to this?
    >
    > e.g
    > Thisworkbook.sheets("name-yyyy").delete exact match
    > The year differs so would like to remove all sheets that starts with:
    > Thisworkbook.sheets("name-").delete (multi delete if poss)
    >
    >
    > --
    > Newbie80
    > ------------------------------------------------------------------------
    > Newbie80's Profile:

    http://www.excelforum.com/member.php...o&userid=25946
    > View this thread: http://www.excelforum.com/showthread...hreadid=393860
    >




  10. #10
    Bob Phillips
    Guest

    Re: need help, want to remove some sheets

    For Each sh In ThisWorkbook.Worksheets
    If Left(sh.Name,5) = "name-" Then
    if ThisWorkbook.Sheets.Count <> 0 Then
    Application.DisplayAlerts = false
    sh.delete
    Application.DisplayAlerts = True
    End If
    End If
    Next sh

    --
    HTH

    Bob Phillips

    "Newbie80" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi, I have some sheets that starts with the same substring and I want
    > all of them to be removed is there a simpel solution to this?
    >
    > e.g
    > Thisworkbook.sheets("name-yyyy").delete exact match
    > The year differs so would like to remove all sheets that starts with:
    > Thisworkbook.sheets("name-").delete (multi delete if poss)
    >
    >
    > --
    > Newbie80
    > ------------------------------------------------------------------------
    > Newbie80's Profile:

    http://www.excelforum.com/member.php...o&userid=25946
    > View this thread: http://www.excelforum.com/showthread...hreadid=393860
    >




  11. #11
    Bob Phillips
    Guest

    Re: need help, want to remove some sheets

    For Each sh In ThisWorkbook.Worksheets
    If Left(sh.Name,5) = "name-" Then
    if ThisWorkbook.Sheets.Count <> 0 Then
    Application.DisplayAlerts = false
    sh.delete
    Application.DisplayAlerts = True
    End If
    End If
    Next sh

    --
    HTH

    Bob Phillips

    "Newbie80" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi, I have some sheets that starts with the same substring and I want
    > all of them to be removed is there a simpel solution to this?
    >
    > e.g
    > Thisworkbook.sheets("name-yyyy").delete exact match
    > The year differs so would like to remove all sheets that starts with:
    > Thisworkbook.sheets("name-").delete (multi delete if poss)
    >
    >
    > --
    > Newbie80
    > ------------------------------------------------------------------------
    > Newbie80's Profile:

    http://www.excelforum.com/member.php...o&userid=25946
    > View this thread: http://www.excelforum.com/showthread...hreadid=393860
    >




  12. #12
    Bob Phillips
    Guest

    Re: need help, want to remove some sheets

    For Each sh In ThisWorkbook.Worksheets
    If Left(sh.Name,5) = "name-" Then
    if ThisWorkbook.Sheets.Count <> 0 Then
    Application.DisplayAlerts = false
    sh.delete
    Application.DisplayAlerts = True
    End If
    End If
    Next sh

    --
    HTH

    Bob Phillips

    "Newbie80" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi, I have some sheets that starts with the same substring and I want
    > all of them to be removed is there a simpel solution to this?
    >
    > e.g
    > Thisworkbook.sheets("name-yyyy").delete exact match
    > The year differs so would like to remove all sheets that starts with:
    > Thisworkbook.sheets("name-").delete (multi delete if poss)
    >
    >
    > --
    > Newbie80
    > ------------------------------------------------------------------------
    > Newbie80's Profile:

    http://www.excelforum.com/member.php...o&userid=25946
    > View this thread: http://www.excelforum.com/showthread...hreadid=393860
    >




  13. #13
    Bob Phillips
    Guest

    Re: need help, want to remove some sheets

    For Each sh In ThisWorkbook.Worksheets
    If Left(sh.Name,5) = "name-" Then
    if ThisWorkbook.Sheets.Count <> 0 Then
    Application.DisplayAlerts = false
    sh.delete
    Application.DisplayAlerts = True
    End If
    End If
    Next sh

    --
    HTH

    Bob Phillips

    "Newbie80" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi, I have some sheets that starts with the same substring and I want
    > all of them to be removed is there a simpel solution to this?
    >
    > e.g
    > Thisworkbook.sheets("name-yyyy").delete exact match
    > The year differs so would like to remove all sheets that starts with:
    > Thisworkbook.sheets("name-").delete (multi delete if poss)
    >
    >
    > --
    > Newbie80
    > ------------------------------------------------------------------------
    > Newbie80's Profile:

    http://www.excelforum.com/member.php...o&userid=25946
    > View this thread: http://www.excelforum.com/showthread...hreadid=393860
    >




  14. #14
    Bob Phillips
    Guest

    Re: need help, want to remove some sheets

    For Each sh In ThisWorkbook.Worksheets
    If Left(sh.Name,5) = "name-" Then
    if ThisWorkbook.Sheets.Count <> 0 Then
    Application.DisplayAlerts = false
    sh.delete
    Application.DisplayAlerts = True
    End If
    End If
    Next sh

    --
    HTH

    Bob Phillips

    "Newbie80" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi, I have some sheets that starts with the same substring and I want
    > all of them to be removed is there a simpel solution to this?
    >
    > e.g
    > Thisworkbook.sheets("name-yyyy").delete exact match
    > The year differs so would like to remove all sheets that starts with:
    > Thisworkbook.sheets("name-").delete (multi delete if poss)
    >
    >
    > --
    > Newbie80
    > ------------------------------------------------------------------------
    > Newbie80's Profile:

    http://www.excelforum.com/member.php...o&userid=25946
    > View this thread: http://www.excelforum.com/showthread...hreadid=393860
    >




  15. #15
    Bob Phillips
    Guest

    Re: need help, want to remove some sheets

    For Each sh In ThisWorkbook.Worksheets
    If Left(sh.Name,5) = "name-" Then
    if ThisWorkbook.Sheets.Count <> 0 Then
    Application.DisplayAlerts = false
    sh.delete
    Application.DisplayAlerts = True
    End If
    End If
    Next sh

    --
    HTH

    Bob Phillips

    "Newbie80" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi, I have some sheets that starts with the same substring and I want
    > all of them to be removed is there a simpel solution to this?
    >
    > e.g
    > Thisworkbook.sheets("name-yyyy").delete exact match
    > The year differs so would like to remove all sheets that starts with:
    > Thisworkbook.sheets("name-").delete (multi delete if poss)
    >
    >
    > --
    > Newbie80
    > ------------------------------------------------------------------------
    > Newbie80's Profile:

    http://www.excelforum.com/member.php...o&userid=25946
    > View this thread: http://www.excelforum.com/showthread...hreadid=393860
    >




  16. #16
    Bob Phillips
    Guest

    Re: need help, want to remove some sheets

    For Each sh In ThisWorkbook.Worksheets
    If Left(sh.Name,5) = "name-" Then
    if ThisWorkbook.Sheets.Count <> 0 Then
    Application.DisplayAlerts = false
    sh.delete
    Application.DisplayAlerts = True
    End If
    End If
    Next sh

    --
    HTH

    Bob Phillips

    "Newbie80" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi, I have some sheets that starts with the same substring and I want
    > all of them to be removed is there a simpel solution to this?
    >
    > e.g
    > Thisworkbook.sheets("name-yyyy").delete exact match
    > The year differs so would like to remove all sheets that starts with:
    > Thisworkbook.sheets("name-").delete (multi delete if poss)
    >
    >
    > --
    > Newbie80
    > ------------------------------------------------------------------------
    > Newbie80's Profile:

    http://www.excelforum.com/member.php...o&userid=25946
    > View this thread: http://www.excelforum.com/showthread...hreadid=393860
    >




  17. #17
    Bob Phillips
    Guest

    Re: need help, want to remove some sheets

    For Each sh In ThisWorkbook.Worksheets
    If Left(sh.Name,5) = "name-" Then
    if ThisWorkbook.Sheets.Count <> 0 Then
    Application.DisplayAlerts = false
    sh.delete
    Application.DisplayAlerts = True
    End If
    End If
    Next sh

    --
    HTH

    Bob Phillips

    "Newbie80" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi, I have some sheets that starts with the same substring and I want
    > all of them to be removed is there a simpel solution to this?
    >
    > e.g
    > Thisworkbook.sheets("name-yyyy").delete exact match
    > The year differs so would like to remove all sheets that starts with:
    > Thisworkbook.sheets("name-").delete (multi delete if poss)
    >
    >
    > --
    > Newbie80
    > ------------------------------------------------------------------------
    > Newbie80's Profile:

    http://www.excelforum.com/member.php...o&userid=25946
    > View this thread: http://www.excelforum.com/showthread...hreadid=393860
    >




  18. #18
    Bob Phillips
    Guest

    Re: need help, want to remove some sheets

    For Each sh In ThisWorkbook.Worksheets
    If Left(sh.Name,5) = "name-" Then
    if ThisWorkbook.Sheets.Count <> 0 Then
    Application.DisplayAlerts = false
    sh.delete
    Application.DisplayAlerts = True
    End If
    End If
    Next sh

    --
    HTH

    Bob Phillips

    "Newbie80" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi, I have some sheets that starts with the same substring and I want
    > all of them to be removed is there a simpel solution to this?
    >
    > e.g
    > Thisworkbook.sheets("name-yyyy").delete exact match
    > The year differs so would like to remove all sheets that starts with:
    > Thisworkbook.sheets("name-").delete (multi delete if poss)
    >
    >
    > --
    > Newbie80
    > ------------------------------------------------------------------------
    > Newbie80's Profile:

    http://www.excelforum.com/member.php...o&userid=25946
    > View this thread: http://www.excelforum.com/showthread...hreadid=393860
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1