该程序应该创建一个按钮,用户可以按下该按钮来激活不同的 sub。从我在网上的搜索来看,打开工作簿时似乎应该激活下面的子,但不是吗?
我究竟做错了什么?
Option Explicit
Private Sub Workbook_Open()
Dim btn As Button
Dim rng As Range
With Worksheets("Sheet1")
Set rng = .Range("B2:C2")
Set btn = .Buttons.Add(rng.Left, rng.Top, rng.Width, rng.Height)
With btn
.Caption = "To begin the program, please click this button"
.AutoSize = True
.OnAction = "TableCreation1"
End With
End With
End Sub