码迷,mamicode.com
首页 > 编程语言 > 详细

Excel Sheet排序

时间:2021-04-27 14:27:14      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:end   exce   integer   sub   excel   str   after   int   code   

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

Excel Sheet排序

标签:end   exce   integer   sub   excel   str   after   int   code   

原文地址:https://www.cnblogs.com/daodaoxun/p/14703492.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!