Can I create a button for a formula?

K

Kristi_ut

I have a formula that I use several times a day in various workbooks. The
formula is always =(I2&" "&J2) written in Cell K2. I created a macro, but it
keeps tying to the workbook. I want to create a button that will automaticly
type this formula no matter the workbook I'm in. Is this possible?
 
S

Susan

yes. when you open the VBA editor to work on your macro, you'll see
two projects, the workbook you're in and another named PERSONAL.XLS.
(if you don't see personal.xls, record some simple macro & tell it you
want it to store in personal.xls, and it will create one. you can
always remove the recorded macro later.)

add a module to personal.xls. copy & paste the pertinent macro that
you already have to personal.xls's new module. now, out in excel,
right click in the toolbars and add a custom button (choose
"Customize", "Commands", "Macros", "Custom Button").
drag the custom button to where you want it on a toolbar. right click
the custom button & assign macro. choose the personal.xls version of
the macro.

now EXIT excel and save your personal.xls (it will ask you). when you
re-open, the button will be there & will run that macro anytime you
push it.
hope this helps.
:)
susan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top