Help with Macros

A

AKD

Hello guys,

Please give me help with doing this. I created two macros, one to show
the grid and another to hide the grid. It's working, but only in the
spreadsheet that I have saved with them, that is Payroll0205. I have
even created two buttons and placed them in the formatting bar.

My question is: how can I have these two macros working in any
spreadsheet I open or create?

Thanks you all!
Ana
 
A

Art Farrell

Hi Ana,

One way is to put the a toggle macro in your Personal.xls and then create a
button on the Standard or Formatting Toolbar and call the macro:

Sub togGrid()
ActiveWindow.DisplayGridlines = Not ActiveWindow.DisplayGridlines
End Sub

If you haven't created buttons, the general procedure is to go to Views >
Toolbars > Customize and then under the Commands
tab select an icon, such as the New icon, and drag it to the top toolbar.
Right click on the icon and select Assign Macro and
direct it to Personal.xls!togGrid. Then select the Edit Button and you can
make changes to the button. I'd erase the tab corner and
inset the letters T/G. Then the macro will be available for all worksheets.

CHORDially,
Art Farrell
 

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