Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default 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
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
how to draw trend lines through only certain data points akh2103 Charts and Charting in Excel 3 April 3rd 23 11:09 AM
VBA to draw lines of SPC Daniel Charts and Charting in Excel 4 July 31st 07 08:44 PM
how to draw a 3-D bar chart in a seperate sheet in the workbook BJS Charts and Charting in Excel 2 November 24th 06 09:01 AM
how do i make a chart with two seperate lines of data? Jason Charts and Charting in Excel 3 October 19th 06 10:41 PM
seperate first 2 lines of column in seperate columns in same row Glynnhamer Excel Discussion (Misc queries) 2 October 9th 06 04:23 AM


All times are GMT +1. The time now is 08:23 AM.

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"