Command Button That Will Toggle
Hi Paige,
Please help me understand why you want to create the button on open.
This seems that would just slow the opening of the workbook.
Dan
On Oct 26, 2:27 pm, Paige wrote:
Thanks, Dan, that's definitely half of it. I still need to develop a sub for
Private Sub Workbook_Open() that creates the button, checks the calculation
state when the workbook is opened, and titles the button to whatever the calc
state is, and then tie the toggling of that button to the code below. Can
you advise on that also?
"dan dungan" wrote:
Woops,
I didn't read your whole question.
Try this instead:
Private Sub CommandButton1_Click()
If Application.Calculation = xlCalculationAutomatic Then
Application.Calculation = xlCalculationManual
CommandButton1.Caption = "AUTO"
ElseIf Application.Calculation = xlCalculationManual Then
CommandButton1.Caption = "MANUAL"
Application.Calculation = xlCalculationAutomatic
End If
End Sub
Dan
|