This program is supposed to create a button that the user can press to activate a different sub. From my searches online, it seems that the sub below should activate when opening up the workbook, but it's not?
What am I doing wrong?
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
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…