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!

Excel macro

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
 
Hi,

Without seeing the code it's hard to say. Perhaps you could post it.

Cheers

[MS MVP - Word]
 


Forum707.

Skip,

[glasses]Have you heard that the roundest knight at King Arthur's round table was...
Sir Cumference![tongue]
 
Thx for replies,

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.

Any ideas, let me know. Thx
 
There's nothing in that macro to open a file - I suspect the problem lies with the button you've attached it to pointing to 'Book1'. In any event, the best place for an application-wide macro is in your Personal.xls file (see Excel's help for details).

I'd also recommend finding out why F9 isn't working, rather than trying to work around it.

Cheers

[MS MVP - Word]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top