LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default Macro to place borders between groups or rows

Jacob,

as usual you have made it look so simple :), thank you. Works absolutely
perfectly.

Thank you so much, hope you have a pleasant weekend.

Regards
Paul

"Jacob Skaria" wrote:

Try the below which works on the active sheet.

Sub MyMacro()
Dim lngRow As Long
For lngRow = 2 To Cells(Rows.Count, "D").End(xlUp).Row
If Range("D" & lngRow) < Range("D" & lngRow + 1) Then
With Range("D" & lngRow).Resize(1, 3).Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
End If
Next
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"PVANS" wrote:

Good morning,

I have a worksheet with rows of data. Column D identifies the client account
number. There are more often more than 1 row of data for the same client
account. The worksheet is already sorted so that the the data is sorted into
the various different clients, ie:
D E F
Client # Description Amount
LBL001 Coke 100
LBL001 Pepsi 50
LBL002 Coke 75
LBL002 Coke 80
LBL002 Pepsi 100
LBL003 Sprite 30
LBL003 Coke 50

I would like a macro to run that places a "Thich Bottom Border" after each
group of like client accounts. Could someone please assist me in a method
that checks whether Column D in one row is the same as the Column D in the
row below, if so, it checks the next row below that, if not, it places a
"thick Bottom Border" to identify that that is the end of one group and start
of the next.

I would really appreciate the help, thank you

Regards

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sort rows and move borders with rows [email protected] New Users to Excel 1 June 4th 09 07:36 AM
Deleting groups of rows when using a macro recording? Paul Excel Discussion (Misc queries) 1 February 6th 09 04:55 PM
Macro to place dated rows in email and send??? PG Oriel Excel Programming 1 October 11th 06 11:05 AM
Adding new rows with borders Corless Excel Programming 6 August 27th 05 06:05 PM
Sum rows in groups sandy Excel Worksheet Functions 5 August 12th 05 12:03 AM


All times are GMT +1. The time now is 07:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"