View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default A toggling border macro

Which 40? Rows/columns, from where.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Tom" wrote in message
...
It works beautifully. Thanks Don. One question, lets say if I wanted to
limit the length of the row to only 40 cells, how do you modify the codes?
Much appreciate for your help.

Tom

"Don Guillett" wrote in message
...
A bit of a variation.

Sub toggleborders()
With Selection.EntireRow
If .Borders.LineStyle = xlNone Then
myBorders = Array(, xlEdgeTop, xlEdgeBottom)
For i = 1 To UBound(myBorders)
With .Borders(myBorders(i))
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = 3
End With
Next
Else
.Borders.LineStyle = xlNone
End If
End With
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Tom" wrote in message
...
On selecting an entire row, how to create a macro (which is to be
attached to a button) that colours the top and bottom borders light red.
Upon reclicking (toggling) the button the coloured borders disappear.
This process is to repeat itself. Thanks for any help.

TIA
Tom