Turn Gridlines on/off

JasonP

New Member
Joined
Jun 21, 2006
Messages
16
Hello

Is there a button in Excel you can press that will turn gridlines on/off rather than going through the tools/options/gridlines route?

Regards

Jason
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Hi,

you could write a macro and assign it to a shortcutkey
Code:
Sub toggle_gridlines()
    ActiveWindow.DisplayGridlines = Not ActiveWindow.DisplayGridlines
End Sub
kind regards,
Erik
 
Upvote 0
Hello,

alternatively, use the predefined button (Look in FORMS - TOGGLE GRID) and move this to a toolbar.
 
Upvote 0
Hello

Thanks for that it's great. Is there any way to use that process to add a button to a toolbar so that you can turn the gridlines on/off in any worksheet/workbook?

Regards

Jason
 
Upvote 0
Hello

Ignore my last post, have found the Toggle Grid button as suggested by onlyadrafter

Thanks a lot

Regards

Jason
 
Upvote 0
Hello,

If you're replying to me, you need to select VIEW --> TOOLBARS --> Customize, from the Commands tab, select FORMS, in the window under Commands: scroll down until you see Toggle Grid. Select this with the mouse and drag it into one of the existing toolbars.

When you restart Excel again, it should be there.
 
Upvote 0
Erik,

The Active Window only works for that sheet. I want to turn the gridlines off in specific tabs. For example I have 14 tabs and I want to write some VBA that when run turns off the gridlines in say 7 of them. Is this possible ?

Thanks
Shane


Hi,

you could write a macro and assign it to a shortcutkey
Code:
Sub toggle_gridlines()
    ActiveWindow.DisplayGridlines = Not ActiveWindow.DisplayGridlines
End Sub
kind regards,
Erik
 
Upvote 0

Forum statistics

Threads
1,214,576
Messages
6,120,350
Members
448,956
Latest member
Adamsxl

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