小编ory*_*000的帖子

VBA:将刚刚创建的图纸移动到工作簿中所有选项卡最右侧的代码

有谁知道在VBA中立即移动刚创建的选项卡到整个工作簿最右侧的选项卡的方法。我的代码现在的工作方式是将选项卡放在最左边(这是默认值)。任何帮助将非常感激。

Sub AddSheet()
Dim wb As Workbook: Set wb = ActiveWorkbook
Dim strName As String: strName = CStr(MaxSheetNumber(wb) + 1)
Dim ws As Worksheet
Set ws = wb.Worksheets.Add(Type:=xlWorksheet)
With ws
    .Name = strName
End With

'Line of code here that would immediately move the new tab "ws" to the furthest right position of all tabs in the workbook

End Sub
Run Code Online (Sandbox Code Playgroud)

excel vba

0
推荐指数
1
解决办法
33
查看次数

标签 统计

excel ×1

vba ×1