0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

VBAでExcelのシートを並べ替え

Posted at

VBAでExcelのシートを並べ替え

ChatGPTにて生成したものを調整、
文章だけでソートプログラムの生成を指定すると
生成されたソートのロジックでエラーが発生し使えなかったので
ある程度ソースをChatGPTに指定しながら生成しました。

Sub MoveSheetsToTheEnd()
    Dim sheetOrder() As Variant
    Dim i As Integer

    ' シートの順番を指定
    sheetOrder = Array("Sheet1", "Sheet2", "Sheet3")

    ' シートを指定された順番に末尾に移動させる
    For i = LBound(sheetOrder) To UBound(sheetOrder)
        Sheets(sheetOrder(i)).Move After:=Sheets(Sheets.Count)
    Next i
End Sub
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?