|
|
|
|
|
|
Excel
|
Hide the Gridlines
|
|
Ease of Use
|
Easy
|
Version tested with
|
2000, 2003
|
Submitted by:
|
johnske
|
Description:
|
On activating a sheet the gridlines become invisible.
|
Discussion:
|
You may often prefer to hide the unsightly gridlines and just view the worksheet exactly as it will appear when it's printed. This is particularly so when you have created a something (such as an invoice/receipt) that you may want to appear as if it's a text document... You can go to Tools/Options and untick Window Options/Gridlines to do this, but this can be time-consuming if you do this regularly, it's much simpler just to paste this code in your ThisWorkbook module and have it done automatically...
|
Code:
|
instructions for use
|
Option Explicit
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
ActiveWindow.DisplayGridlines = False
End Sub
|
How to use:
|
- Open an Excel workbook
- Select Tools/Macro/Visual Basic Editor
- In the VBE window, select Tools/Project Explorer
- Select the ThisWorkbook module
- Copy and paste the code into the Module
- Now select File/Close and Return To Microsoft Excel
- Save your changes...
|
Test the code:
|
- Click a worksheet tab and watch the gridlines disappear.
|
Sample File:
|
HideGridlines.zip 6.03KB
|
Approved by mdmackillop
|
This entry has been viewed 176 times.
|
|