modify to suit
Sub bordersaround()
Worksheets("Sheet1").Range("A1

4").BorderAround _
ColorIndex:=3, Weight:=xlThick
'Selection.bordersaround
End Sub
Sub noborders()
Worksheets("Sheet1").Range("A1

4") _
.Borders.LineStyle = xlNone
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"Orlanzo" <(E-Mail Removed)> wrote in message
news:314419E4-6DC4-484E-805D-(E-Mail Removed)...
> Is it possible to apply a border around groups of data.
>
> For example, give the the sample sheet below, a border would surround the
> groups of fruit. Borders would highlight the Apple, Orange, and Pear
> sections.
>
> A B C
> ====================
> Apple 12 13
> Apple 13 2
> Apple 4 5
> Orange 40 12
> Pear 45 13
> Pear 4 11
>
> Is thier a simple way to have this automatically applied or must it be
> done
> programmatically. The data within the sheet is refreshed daily. In lieue
> of
> setting the borders manually, I'd like to have a more automated approach.
>
> If it must be done programmatically, what would the routine look like in
> general. Would I need to scan the column containing the grouping field to
> help define the range or is their another approach to setting the borders?
> Lastly, can the code be tied to an event that run when the workbook is
> opened
> and the borders haven't been applied?
>