View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
MattyO MattyO is offline
external usenet poster
 
Posts: 9
Default Add Border to the right side (xlEdgeRight) of a large number o

ker_01

In this case, I only want row 9 for all these columns to do this, not every
row in the worksheet.
When I change your first line out to Columns("A9:DE9").Select, it doesn't
work.


"ker_01" wrote:

When I record a macro while adding interior lines, I get the following:

Columns("A:DE").Select
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With

HTH,
Keith


"MattyO" wrote in message
...
So I have a very large report with a ton columns that I would to add a
border
on the right edge. Do I need to repeat this code for each column (see
below), because the columns go way out to DE and that would see quite
cumbersome.
-------
Range("A9").Select
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With

Range("B9").Select
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
-----

Finally I tried this:
Range("A9:D9").Borders(xlEdgeRight).Weight = xlThin

...but that only put the border on D9 and that doesn't work.

Thanks!