Skip to main content
Support is Offline
Today is our off day. We are taking some rest and will come back stronger tomorrow
Official support hours
Monday To Friday
From 09:00 To 17:30
  Saturday, 09 May 2020
  1 Replies
  5.5K Visits
0
Votes
Undo
Hello. With only one of my worksheets, whenever I click on one of the tabs listed on the left side of the screen, that tab then goes to the top of the list and my tabs along the bottom of the Excel file are automatically reordered. This is not occurring with other Excel worksheets. In those other worksheets, I can navigate to one tab or another by clicking on the list and everything stays in the same order. But not on this one Excel worksheet. I want to stop the tabs from being re-ordered. In the screenshot, for example, you'll see Jan 6-12 and Jan 13-19 listed at the bottom of the list, whereas before those were listed at the top. Can you help me out on this? This is on a Windows 10 system with Excel 2007. I tried to upload a screenshot by clicking on the Attachments box, but don't seem to be able to.
3 years ago
·
#2132
0
Votes
Undo
This will move your hidden sheet to end of all visible sheets:
Sub test()
    With Sheets("Sheet1")
        .Visible = True
        Sheets("Sheet1").Move After:=Sheets(Sheets.Count)
        .Visible = False
    End With
End Sub
And this will move your hidden sheet to the end of all hidden and visible sheets:
Sub moveHiddenSheet()
Dim ws, x, lastSheet
x = 0
For ws = Worksheets.Count To 0 Step -1
    x = x + 1
    If Sheets(Worksheets.Count - x).Visible = False Then
        Sheets(ws).Visible = xlSheetVisible
        lastSheet = Sheets(ws).Name
        Exit For
    End If
Next ws
With Sheets("Sheet1")
    .Visible = True
    Sheets("Sheet1").Move After:=Sheets(Worksheets.Count) 
    .Visible = False
End With
Sheets(lastSheet).Visible = False
End Sub
  • Page :
  • 1
There are no replies made for this post yet.