Written by Allen Wyatt (last updated June 9, 2023)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and 2021
Most people using Excel leave the gridlines visible so that they can easily see where the various cells are. By default, the gridlines are a light gray. You can easily change the gridlines to a different color by following these steps:
Figure 1. The Advanced options of the Excel Options dialog box.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (6210) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and 2021. You can find a version of this tip for the older menu interface of Excel here: Changing the Color of Worksheet Gridlines.
Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!
Freezing the top rows in a worksheet so that they are always visible is easy to do. Freezing the bottom rows is not so ...
Discover MoreWhen worksheet names are quite long, it can present problems in displaying those names in the tabs at the bottom of the ...
Discover MoreWant a quick way to insert a worksheet? There's nothing faster than using the handy shortcut.
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2021-02-06 14:28:37
John Mann
This bears further investigation on my part - thanks for idea. When I set the grid lines colour to a non-standard colour, I usually match them to the colour of the tab for the worksheet. Setting the grid colour to match the tab colour is an attempt to replace the very nice feature in Lotus 1-2-3 whereby the tab colour o the entire active sheet is reproduced as a line across the top of the sheet. (1-2-3 has it's tabs across the top, instead of wasting space in the status bar. (see Figure 1 below)
It would seem to me, therefor, that modifying the macro to pick up the colour of the worksheet tab, and then applying it tothe gridlines of not just a range of cells but to the entire sheet would be very useful. Something to experiment with while I'm learning macros.
Figure 1. Lotus 1-2-3 tabs
2021-01-31 06:55:02
Harold Druss
For John Mann:
How about a macro?
Sub SetBackgroundColor()
Dim rng As Range
Set rng = Range("D1, D3, D5, D7")
With rng
.Interior.ColorIndex = 8
.BorderAround ColorIndex:=1, Weight:=xlThin
End With
End Sub
2021-01-30 16:51:12
John Mann
I've used this option on a number of occasions for various reasons - practical or just to look pretty.
It doesn't solve a problem I've encountered with Excel 2010 (can't write about other versions) where when I set a background colour for a range of cells, the grid-lines disappear. If I want them to be visible within a coloured ranged, I have to actually format the range with external and internal borders of the desired colour. On some occasions I've done that by selecting the entire sheet, then setting the border colours.
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2025 Sharon Parq Associates, Inc.
Comments