Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to draw lines to seperate data
Garry
This sub does it for columns A and B. If you need help making it relative to whatever columns are selected, post back. Sub CreateUnderlines() Dim rCell As Range For Each rCell In Sheet1.Range("A1:A9").Cells If rCell.Value < rCell.Offset(1, 0).Value Then Intersect(rCell.EntireRow, rCell.Parent.UsedRange) _ .Borders(xlEdgeBottom).LineStyle = xlContinuous ElseIf rCell.Offset(0, 1).Value < rCell.Offset(1, 1).Value Then Intersect(rCell.EntireRow, rCell.Parent.UsedRange) _ .Borders(xlEdgeBottom).LineStyle = xlDash End If Next rCell End Sub -- Dick Kusleika MVP - Excel Excel Blog - Daily Dose of Excel www.dicks-blog.com "garrylwhiting" wrote in message ... I would like to create a macro to automaticly insert a solid or dash line to seperate data after each change in value of any given column. As an example after the data sheet has been sorted using column A "car manufacture" all the Chevy, Ford, or Honda would have a solid line drawn under the data. Also within each group, column B "type of vehicle", (car, pickup, SUV) would be seperated with a dash line. I would like to be able to use a User Form to select which cloumn will be underlined using the solid line and which will column will be underlined using the dash line. -- garrylwhiting ------------------------------------------------------------------------ garrylwhiting's Profile: http://www.excelforum.com/member.php...o&userid=16214 View this thread: http://www.excelforum.com/showthread...hreadid=276298 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to draw trend lines through only certain data points | Charts and Charting in Excel | |||
VBA to draw lines of SPC | Charts and Charting in Excel | |||
how to draw a 3-D bar chart in a seperate sheet in the workbook | Charts and Charting in Excel | |||
how do i make a chart with two seperate lines of data? | Charts and Charting in Excel | |||
seperate first 2 lines of column in seperate columns in same row | Excel Discussion (Misc queries) |