Toggle Grid Short cut key

stonee

New Member
Joined
Feb 17, 2009
Messages
32
Hi Team,

This is to inform you that I frequently use toggle grid tool to make my worksheet white/plain,doing this with the help of mouse is eating lot of my time which i really feel anonying/pain.

I would like to have a short cut key for toggle grid which lies in Forms toolbar.

Kindly do the needful.

Thanks in advance

With regards,
Stonne
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Record a macro to do anything and pick the shortcut key you'd like to use. Then edit the code and replace with the following

Code:
ActiveWindow.DisplayGridlines = Not ActiveWindow.DisplayGridlines
 
Upvote 0
Hi.. Thanks for your reply, but I am very sorry to say that I don't know how to run macro. I am having zero knowledge in VBA.

Could you pls tell me step by step how to do that?

I hope you will understand my weakness.

Yours help will be appreciated.

With Regards,
Stonee
 
Upvote 0
Place this in a regular module. Open the VBE(ALT+F11) and Choose Insert>Module Paste in this code
Code:
Sub ToggleGrid()
'
' Keyboard Shortcut: Ctrl+r
'
If ActiveWindow.DisplayGridlines = False Then
    ActiveWindow.DisplayGridlines = True
    Else: ActiveWindow.DisplayGridlines = False
End If
End Sub
Exit the VBE(ALT+Q)
Assign a shortcut key. (I used CTRL+r). Enter ALT+F8. Select the macro and choose "Options"

lenze
 
Upvote 0
Hi,
Thanks a lot,but it is working only for existing sheet.

My requirement is when ever I open new excel sheet/any excel sheet,short cut key ctrl+r should work for toggle grid. Is there any way through VBA?

Yours help will be appreciated.

With Regards,
Stonee.
 
Upvote 0
Simply place your macro in your Personal.xls. Don't have one? Create it by choosing>Tools>Macros>Record New Macro. Select Store in "Personal Macro WorkBook". Click OK and then stop recording. Close Excel and reopen. Your Personal WB will open automatically, but will be hidden. To access it, chose Window>Unhide. Place your code in a regular module and rehide the WB. Close Excel, saving, and reopen. Your macro will now be available for all Open WBs.
lenze
 
Upvote 0
Thanks a ton Sir.... It's working.. wow......great...

Ok.. next.. What incase I would like to remove this short cut or How to delete it or how to manipulate?

Thanks in advance

With Regards,
Stonee
 
Upvote 0
Press Alt+F8, select the macro, press Options, delete the contents of the shortcut key box, click OK then Cancel.
 
Upvote 0
Thanks a lot. I am very sorry for the delay response. Actually I went my aunt home on my vacation.

I would like to have a short cut key for "All border" which lies in formatting toolbar through macro. I will post in new thread.

Thanks in advance.


Bye, Take care..
 
Upvote 0

Forum statistics

Threads
1,213,557
Messages
6,114,293
Members
448,564
Latest member
ED38

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top