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

    Why the macro not esclude the sheet... (2000 sr 1)

    Why not is exluded the sheet FIPO_TOTALE?



    Dim I As Integer
    Dim j As Integer

    Application.ScreenUpdating = False

    Worksheets("TEMPLATE").Visible = False

    For I = 1 To Sheets.Count - 1
    For j = I + 1 To Sheets.Count
    If Sheets(I).Name <> "MENU" And Sheets(I).Name <> "RICHIESTE" And Sheets(I).Name <> "FIPO_TOTALE" And _
    Sheets(j).Name <> "MENU" And Sheets(j).Name <> "RICHIESTE" And Sheets(j).Name <> "FIPO_TOTALE" And _
    UCase(Sheets(I).Name) > UCase(Sheets(j).Name) Then _
    Sheets(j).Move Before:=Sheets(I)
    Next j
    Next I

    Application.ScreenUpdating = True

    Worksheets("TEMPLATE").Visible = True

    End Sub

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

    Re: Why the macro not esclude the sheet... (2000 sr 1)

    Check very carefully that the name of your sheet is really <code>"FIPO_TOTALE"</code> (without the quotes), and not (for example)
    <code>"FIPO-TOTALE"</code> ( - instead of _ )
    or
    <code>"FIPO_TOTALE "</code> (space after the name)
    or
    <code>" FIPO_TOTALE"</code> (space before the name)

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

    Re: Why the macro not esclude the sheet... (2000 sr 1)

    My head, naturally, is fired!
    Test for me!
    Tks.
    Note: i have make all you suggestion... but no work!

  4. #4
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Why the macro not esclude the sheet... (2000 sr 1)

    Without testing, I see that there is no sheet called MENU but there is one called NENU.

    Sal, instead of excluding all the text-name sheets, how about testing for a numeric named sheet, something like (untested):

    For I = 1 To Sheets.Count - 1
    For j = I + 1 To Sheets.Count
    If IsNumeric( (Sheets(I).Name) And IsNumeric( (Sheets(j).Name) And _
    UCase(Sheets(I).Name) > UCase(Sheets(j).Name) Then _
    Sheets(j).Move Before:=Sheets(I)
    Next j
    Next I
    -John ... I float in liquid gardens
    UTC -7ąDS

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

    Re: Why the macro not esclude the sheet... (2000 sr 1)

    As John notes, the worksheet MENU is misspelled NENU. Also, there is no worksheet named TEMPLATE. Apart from that, the code works OK.

Posting Permissions

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