Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Borders in Excel 1

Status
Not open for further replies.

AgentM

MIS
Jun 6, 2001
387
US
Can somebody give me the code for drawing Borders around a cell in a worksheet in Excel?
I have tried recording a macro.
But it gives errors.

Any help appreciated.
 

' Color = 1
' Style = 1
' Wt = 4 (xlThick) or 2 (xlThin)
XEdge = 8 'Top
XEdge = 9 'Bottom
XEdge = 7 'Left
XEdge = 10 'Right

Actv.Range(Xrange).Borders(xEdge).Color = 1
Actv.Range(Xrange).Borders(XEdge).LineStyle = 1
Actv.Range(Xrange).Borders(XEdge).Weight = 4

fengshui_1998
 
How did you come across the numeric equivalent of
XEdge for Top, Bottom etc...?

Thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top