Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add a button in the icon bar 2

Status
Not open for further replies.

XeroLui

Technical User
Jun 6, 2001
12
0
0
HK
How to make a button for enable/disable the "automatic calculation" in the MS-Excel icon bar?
 
You need to write a small macro, place a button on the toolbar, then assign the macro to the button.

This code works in Excel 2000:


With Application
If .Calculation = xlCalculationManual Then
.Calculation = xlCalculationAutomatic
Else
.Calculation = xlCalculationManual
End If
End With



Create a macro in your worksheet called ToggleCalculate, then go into the VB editor and paste the code between the Sub ToggleCalculate() and End Sub lines.

Now go to the worksheet, right click on the toolbars, and click Customize from the drop-down menu. Select the Commands tab, select Macros, then drag-and-drop the Smiley Face icon to your toolbar (you can edit it later). Close the Customize dialog.

Finally, right-click on the new icon, and select Assign Macro. From the Macros list, select ToggleCalculate.

Should do it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top