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

    ERROR ON HIDE SHEET (2000 sr 1)

    Sub ORDINA_UFF()

    Sheets("SPORTELLI").Activate
    Workbook.Sheets("SPORTELLI").Select
    Columns("B:C").Select
    Selection.Sort Key1:=Range("B1"), Order1:=xlAscending, Header:=xlGuess, _
    OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
    Range("A1").Select

    End Sub

    While i recive error during this macro?
    note:The sheet is hide in my wbook

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

    Re: ERROR ON HIDE SHEET (2000 sr 1)

    The problem is that you try to Select a hidden sheet. That is not possible, of course. But you don't need to:

    Sub ORDINA_UFF()
    With Sheets("SPORTELLI")
    .Range("B1").Sort Key1:=.Range("B1")
    End With
    End Sub

    In general, try to avoid selecting worksheets and ranges in a macro. In most cases, it is not necessary, and code will run more efficiently if you don't use Select and Selection.

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

    Re: ERROR ON HIDE SHEET (2000 sr 1)

    GOOD EXPLAIN.
    Tks.

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

    Re: ERROR ON HIDE SHEET (2000 sr 1)

    Hans, same problem with this 2 macro
    the hide sheet is: MATRICOLE



    Sub RICOPIA001()

    '
    Range("B5").Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.Copy
    Sheets("MATRICOLE").Select
    Range("A1").Select
    Range(Selection, Selection.End(xlDown)).Select
    Application.CutCopyMode = False
    Selection.ClearContents
    Range("A1").Select
    Sheets("PRESENZE").Select
    Selection.Copy
    Sheets("MATRICOLE").Select
    ActiveSheet.Paste
    Range("A1").Select
    Sheets("PRESENZE").Select
    Application.CutCopyMode = False
    Range("A5").Select

    Call DUPLICATI001

    End Sub
    Sub DUPLICATI001()

    Sheets("MATRICOLE").Select
    Dim n As Range
    [A:A].AdvancedFilter Action:=xlFilterInPlace, Unique:=True
    Set n = [A:A].SpecialCells(xlCellTypeVisible)
    ActiveSheet.ShowAllData
    n.EntireRow.Hidden = True
    [A:A].SpecialCells(xlCellTypeVisible).EntireRow.Delete
    [A:A].EntireRow.Hidden = False
    Sheets("PRESENZE").Select
    Range("A5").Select

    End Sub

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

    Re: ERROR ON HIDE SHEET (2000 sr 1)

    Sal,

    Try to understand the code. You should be able to modify the code yourself by now, you can't keep on relying on the Lounge to do all your work for you.

    Sub RICOPIA001()
    Sheets("MATRICOLE").Range(Sheets("MATRICOLE").Rang e("A1"), _
    Sheets("MATRICOLE").Range("A1").End(xlDown)).Clear Contents
    Sheets("PRESENZE").Range(Sheets("PRESENZE").Range( "B5"), _
    Sheets("PRESENZE").Range("B5").End(xlDown)).Copy Sheets("MATRICOLE").Range("A1")
    Call DUPLICATI001
    End Sub

    Sub DUPLICATI001()
    Dim rng As Range
    Sheets("MATRICOLE").Select
    Sheets("MATRICOLE").Range("A:A").AdvancedFilter Action:=xlFilterInPlace, Unique:=True
    Set rng = Sheets("MATRICOLE").Range("A:A").SpecialCells(xlCe llTypeVisible)
    Sheets("MATRICOLE").ShowAllData
    rng.EntireRow.Hidden = True
    Sheets("MATRICOLE").Range("A:A").SpecialCells(xlCe llTypeVisible).EntireRow.Delete
    Sheets("MATRICOLE").Range("A:A").EntireRow.Hidden = False
    Set rng = Nothing
    End Sub

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

    Re: ERROR ON HIDE SHEET (2000 sr 1)

    i am sorry!

Posting Permissions

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