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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recalculate Excel Worksheet 1

Status
Not open for further replies.

DeLaMartre

Technical User
Dec 26, 2001
213
US
I am using the Rand() function in a worksheet, and would like to be able to link a macro to a button (I know how to do that part) that would enable the user to recalculate the worksheet.

The problem is that I am basically ignorant when it comes to VBA and the needed macro to do this manual recalculation. By the way, I do not want to use F9, as I want this linked to a button that the user can click.

Any help regarding the needed code would be greatly appreciated!

Thanks very much,

-Bob in California

 
You could customize a toolbar and put the Calculate Now toolbar button there.

The user could mouse click it when required.

Glenn.
 
Thanks for the suggestion, Glenn. My fault for not being more specific. I am building an "Excel Slot Machine" for a training event in the office, so I need the recalculation code to link to the "slot machine" button.

Any other suggestions?

Many thanks,

-Bob in California

 
All you need in a one line macro, with this code:

Application.Calculate


If you create a button using the Control toolbar tools, then right-click it, and put the code ( above ) into the Sub that has been created for you, and click the "Exit Design Mode" button, and you're done.

Cheers, Glenn.
 
Ah, elegant simplicity!

Thanks so much for your advice and time, Glenn!

Cheers, indeed,

-Bob in California

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top