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

Macro opens same workbook every time

Status
Not open for further replies.

32131232424q2

IS-IT--Management
Apr 11, 2008
9
GB
Hi,

I'd like to know how to assign a macro to a toolbar without the macro opening the original document the macro was written in.

Essentially, I need to open an excel workbook (say book1) to write a macro, but I wan't to use this macro with several workbooks. I've assigned the macro to a toolbar button, but every time i click the button it proceeds to open book1 - how can i stop this so that it works only for that workbook?

Here's the code:

Sub updater_()
Application.Calculate
End Sub

I believe this does the same job as hittig F9 on the keyboard, but sometimes on the worksheet f9 doesn't seem to work, so I've written this macro as a work around.

Thx
 
What about putting your macro in your Personal.xls workbook ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Why vba? There are two build-in calculation options (active workbook and all workbooks) the user can add to menu/toolbar (tools category), without any code at all.

combo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top