Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 259
Default length of line depending on the value of the cell

Hey Don

Very nice, neat code, although the OP requirement was if A1 has the value of
1 then B1 will have a line.

Your code places a line under A1 when the value is 1 instead of B1.

Cheers
Mick.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,522
Default length of line depending on the value of the cell

On Aug 15, 9:43*am, "Vacuum Sealed" wrote:
Hey Don

Very nice, neat code, although the OP requirement was if A1 has the value of
1 then B1 will have a line.

Your code places a line under A1 when the value is 1 instead of B1.

Cheers
Mick.


Simple change
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A1")) Is Nothing Then Exit Sub
Rows(1).Borders(xlEdgeBottom).LineStyle = xlNone
Range(Cells(1, 2), Cells(1, Target + 1)) _
..Borders(xlEdgeBottom).LineStyle = xlContinuous
End Sub
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
Line with length depending on the value of the cell Subodh Charts and Charting in Excel 1 August 29th 11 09:21 PM
Line with length depending on the value of the cell Subodh Excel Discussion (Misc queries) 3 August 16th 11 12:05 AM
Compute length of a string in points depending on current font [email protected] Excel Programming 6 February 1st 08 09:02 PM
How to insert line of text on other worksheet depending upon result in a cell? Pheasant Plucker® Excel Discussion (Misc queries) 3 March 20th 06 03:05 PM
How to insert line on other worksheet depending upon result in cell? Pheasant Plucker® Excel Discussion (Misc queries) 4 March 17th 06 09:05 AM


All times are GMT +1. The time now is 09:50 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"