Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 168
Default Macro to Format Lines Between Rows

I want to be able to go down column A in a worksheet and if the next entry is
not the same as the previous, I want to put a line between the two rows. How
would I go about doing this?

Thanks

Adam Bush
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,327
Default Macro to Format Lines Between Rows

Hi Adam

One way among many:

Sub test()
Dim R As Long
Dim V As Variant
V = Range("A1").Value
For R = 1 To Cells(Rows.Count, 1).End(xlUp).Row + 1
If Cells(R, 1).Value < V Then
V = Cells(R, 1).Value
With Cells(R - 1, 1).Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThick
End With
End If
Next
End Sub

HTH. Best wishes Harald
"
m skrev i melding
...
I want to be able to go down column A in a worksheet and if the next entry
is
not the same as the previous, I want to put a line between the two rows.
How
would I go about doing this?

Thanks

Adam Bush



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Macro to Format Lines Between Rows

Sub Addrows()

RowCount = 1
Do While Range("A" & RowCount) < ""
If Range("A" & RowCount) < Range("A" & (RowCount + 1)) Then
Rows(RowCount + 1).Insert
RowCount = RowCount + 2
Else
RowCount = RowCount + 1
End If
Loop

End Sub

" wrote:

I want to be able to go down column A in a worksheet and if the next entry is
not the same as the previous, I want to put a line between the two rows. How
would I go about doing this?

Thanks

Adam Bush

Reply
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
Format new Lines into Columns efenili Excel Worksheet Functions 1 May 16th 06 06:09 PM
I want to print more than 17 lines in a merged box with 30 rows. Raise place Excel Worksheet Functions 0 March 7th 06 03:51 PM
lines colors when selecting rows bobandmarsha Setting up and Configuration of Excel 1 January 25th 06 08:31 PM
How do I add lines to my rows and columns? KatyKleymeyer Setting up and Configuration of Excel 1 August 2nd 05 06:27 AM
need rows and columns with lines printed Jen Excel Discussion (Misc queries) 1 July 28th 05 04:27 PM


All times are GMT +1. The time now is 03:43 PM.

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

About Us

"It's about Microsoft Excel"