cellMatrix.net

Spreadsheet Modeling and Related Topics

Show Gridlines when Filling an Interior Range

Dick Kuslieka at the Daily Dose of Excel recently posted a macro that allows the user to create the illusion of gridlines when filling an interior worksheet range. Thinking this a good addition to my Excel toolbox, I've copied it from Dick's site for reference.

Sub ColorRange()
    
    With Selection
        Selection.BorderAround xlContinuous, xlThin, , RGB(192, 192, 192)
        If .Columns.Count> 1 Then
            With .Borders(xlInsideVertical)
                .LineStyle = xlContinuous
                .Weight = xlThin
                .Color = RGB(192, 192, 192)
            End With
        End If
        If .Rows.Count> 1 Then
            With .Borders(xlInsideHorizontal)
                .LineStyle = xlContinuous
                .Weight = xlThin
                .Color = RGB(192, 192, 192)
            End With
        End If
    End With
    
End Sub

Posted on Thursday, October 29, 2009 | Comments (0) | Permalink

Page 1 of 1 pages

Statistics

  • Total Entries - 136
  • Current Viewers - 31

Categories

Entries by Day

Jul - 2010
S M T W T F S
27 28 29 30 1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

Recent Comments

Syndicate