Border for range

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi. How to set a solid border for range, not for each cell. For example

Range("A1:A3")

Greetings and thanks for help
 
Dim myR As Range

Set myR = Range("A1:A3")

myR.Borders(xlEdgeLeft).LineStyle = xlContinuous
myR.Borders(xlEdgeTop).LineStyle = xlContinuous
myR.Borders(xlEdgeBottom).LineStyle = xlContinuous
myR.Borders(xlEdgeRight).LineStyle = xlContinuous
myR.Borders(xlInsideHorizontal).LineStyle = xlNone


You can also set the line weight and color:
myR.Borders(xlEdgeLeft).Weight = xlThin
myR.Borders(xlEdgeLeft)..ColorIndex = xlAutomatic

etc.

HTH,
Bernie
MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top