PC Review


Reply
Thread Tools Rate Thread

Bordering Groups of Data

 
 
=?Utf-8?B?T3JsYW56bw==?=
Guest
Posts: n/a
 
      13th Nov 2007
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?

 
Reply With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      13th Nov 2007
modify to suit

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


Sub noborders()
Worksheets("Sheet1").Range("A14") _
.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?
>


 
Reply With Quote
 
=?Utf-8?B?SmltIFRob21saW5zb24=?=
Guest
Posts: n/a
 
      13th Nov 2007
I would be inclined to use conditional formatting based on whether the vlaue
in column A changes. Format -> Conditional Format -> Formula =$A2<>$A1
(applied to the entire column)...
--
HTH...

Jim Thomlinson


"Orlanzo" wrote:

> 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?
>

 
Reply With Quote
 
=?Utf-8?B?T3JsYW56bw==?=
Guest
Posts: n/a
 
      13th Nov 2007
Jim,
I applied the formula, not to the entire column, but to the first column of
the rows comprising the range. It had no affect. The range begins at A3, so
I modified the formula to erad = $A4<>$A3. It didn't have an affect.

I say all of this with the caveat - I'm not an excel expert by any means.
All of this may be an issue with my limited knowledge of the product.

"Jim Thomlinson" wrote:

> I would be inclined to use conditional formatting based on whether the vlaue
> in column A changes. Format -> Conditional Format -> Formula =$A2<>$A1
> (applied to the entire column)...
> --
> HTH...


 
Reply With Quote
 
=?Utf-8?B?SmltIFRob21saW5zb24=?=
Guest
Posts: n/a
 
      13th Nov 2007
Place your cursor in Cell A2:A10 (A2 should be the active cell). Select
Format | Conditional Format. Change from Cell Value Is to Formula Is. Add the
formula =$A2<>$A1. Change the format to Add a underline border. Click Ok...
--
HTH...

Jim Thomlinson


"Orlanzo" wrote:

> Jim,
> I applied the formula, not to the entire column, but to the first column of
> the rows comprising the range. It had no affect. The range begins at A3, so
> I modified the formula to erad = $A4<>$A3. It didn't have an affect.
>
> I say all of this with the caveat - I'm not an excel expert by any means.
> All of this may be an issue with my limited knowledge of the product.
>
> "Jim Thomlinson" wrote:
>
> > I would be inclined to use conditional formatting based on whether the vlaue
> > in column A changes. Format -> Conditional Format -> Formula =$A2<>$A1
> > (applied to the entire column)...
> > --
> > HTH...

>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bordering in Excell olrjr Microsoft Excel Misc 2 31st Dec 2008 11:51 PM
Bordering for Report Agnelo Fernandes Microsoft Access Reports 5 10th Oct 2008 02:59 PM
Bordering text in a style =?Utf-8?B?TWlubmllIE0=?= Microsoft Word Document Management 3 18th Oct 2007 07:20 AM
Bordering =?Utf-8?B?QXNoaXNoIE1hdGh1cg==?= Microsoft Excel Programming 2 25th May 2005 06:22 AM
Cell bordering =?Utf-8?B?QWxiZXJ0IEphbWVzb24=?= Microsoft Excel Programming 3 13th Oct 2004 05:18 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:13 PM.