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

Comment Entry Form

User Information

Name: (Required)

E-Mail Address: (Optional)

Location: (Optional)

Web Site Address: (Optional)

Comment Formatting Reference
Add VBA Code:
<pre>some code here</pre>
Linking:
[url]http://www.example.com/[/url]
[url=http://www.example.com/]my site[/url]
Text Formatting
[size=4]Some larger text[/size]
[color=green]Some green text[/color]
[b]Some bold text[/b]
[i]Some italic text[/i]
Enter Comment Below

Personalization Options
Remember my personal information
Notify me of follow-up comments?

Next entry: Arrays to Calculate Consistent Increases in Rate Spreads

Previous entry: Delete All Embedded Charts from a Workbook

<< Back to main

Statistics

  • Total Entries - 134
  • Current Viewers - 13

Categories

Entries by Day

Mar - 2010
S M T W T F S
28 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 1 2 3

Recent Comments

Syndicate