我当前拥有的代码添加了一个工作表,但是没有将模板布局移到添加的工作表中。添加的工作表已重命名,但为空白。有人可以帮我吗。
Private Sub CommandButton1_Click()
Dim sh As Worksheet
Dim shName As String
'name of the sheet template
shName = "SharePoint Metrics Template.xltm"
'Insert sheet template
With ThisWorkbook
Set sh = Sheets.Add(Type:="https://simcoelectronics-my.sharepoint.com/:x:/g/personal/zack_thompson_simco_com/EQrznpv-QI9MttaVe713ilEBwmt9VDUa0nztAMd-ebeeeA?e=r9VHMK" & shName, _
after:=.Sheets(.Sheets.Count))
End With
'Give the sheet a name, today's date in this example
On Error Resume Next
sh.Name = Format(Date, "mm-dd-yyyy")
If Err.Number > 0 Then
MsgBox "Change the name of Sheet : " & sh.Name & " manually"
Err.Clear
End If
On Error GoTo 0
结束子