其他分享
首页 > 其他分享> > Excel Sheet排序

Excel Sheet排序

作者:互联网

Sub Sort_Sheets()
  Dim sCount As Integer, I As Integer, R As Integer
  ReDim Na(0) As String
  sCount = Sheets.Count
  For I = 1 To sCount
      ReDim Preserve Na(I) As String
      Na(I) = Sheets(I).Name
  Next
  For I = 1 To sCount - 1
      For R = I + 1 To sCount
          If Na(R) < Na(I) Then
             JH = Na(I)
             Na(I) = Na(R)
             Na(R) = JH
          End If
      Next
  Next
  For I = 1 To sCount
      Sheets(Na(I)).Move After:=Sheets(I)
  Next
End Sub

标签:Sheet,sCount,Na,Excel,Next,Sheets,Integer,排序,Sub
来源: https://www.cnblogs.com/daodaoxun/p/14703492.html