General discussion

Locked

Changing Borders in VBA for EXCEL

By pfecteau ·
I've been asked if there is a way in VBA for EXCEL to place a heavy border line between every 5 rows in a spreadsheet, and to have the separation lines shift whenever rows are inserted or deleted. I have a way to change the shading using the Rows(i).Interior.ColorIndex property, but I can't find a property defining the borders. Any help would be greatly appreciated.

A sample of code accoumplishing this would be even more appreciated.

TIA - Phil

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Changing Borders in VBA for EXCEL

by DKlippert In reply to Changing Borders in VBA f ...

look at:
http://www.cpearson.com/excel/banding.htm

The code for borders if you want to go the VBA route is something like:
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThick
.ColorIndex= xlAutomatic
End With

Collapse -

Changing Borders in VBA for EXCEL

by pfecteau In reply to Changing Borders in VBA f ...

Used the code as the basis for a routine

Collapse -

Changing Borders in VBA for EXCEL

by pfecteau In reply to Changing Borders in VBA f ...

This question was closed by the author

Back to Web Development Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums