-
Solved: Put borders around selected range
Hello members!
Not much of a programmer.
All I want to do is put a thin line border around each cell in the selected range.
I used the macro recorder and it generated about 50 lines of code. I kind of figured that it could be done with a few lines of code using a For Next loop but I'm failing miserably!
Basically, I want to do this:
For each cell in selection
put a thin line border around the cell
next cell
Can anyone point me in the right direction?
-
Looping is not needed
[VBA]Sub trial()
With Selection.Borders
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End Sub[/VBA]
-
Nice and compact.
Works very well.
Thank you, mikerickson
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules