Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default Conditional borders


Public Sub DrawBorders_R2()
Dim N As Long
Dim numRows As Long
Dim numStart As Long

numStart = 2 'Start row must be 2 or more.
numRows = ActiveSheet.UsedRange.Rows(ActiveSheet.UsedRange.R ows.Count).Row

Application.ScreenUpdating = False
Range(Cells(numStart - 1, 1), Cells(numRows, 5)).Borders.LineStyle = xlLineStyleNone
For N = numStart To numRows
If Cells(N, 3).Offset(1, 0).Value < Cells(N, 3).Value Then
With Cells(N, 1).Resize(1, 5).Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThick
.ColorIndex = 1
End With
End If
Next
Application.ScreenUpdating = True
End Sub

--
Jim Cone
Portland, Oregon USA
http://www.mediafire.com/PrimitiveSoftware

..
..
..

"Slim Slender"
wrote in message
...
Jim,
Thanks for your reply. The endless loop problem is solved. However, I
cannot afford to clear all formatting because there is other
formatting in the table besides the thick borders. I have to be able
to remove and replace only the thick borders. Also, this code is
placing the borders across columns A thru G (7 columns, or 5 columns
from C) instead of just A thru C (total of 5 columns). Also, it is
affecting the header row. Can we make it start at row 2 and leave the
header row alone? Thanks again.
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
conditional formatting borders PhilosophersSage Excel Discussion (Misc queries) 9 October 2nd 09 05:47 PM
Conditional Formatting Borders AJ Excel Discussion (Misc queries) 2 January 29th 09 05:53 PM
Conditional Format Borders clark-ee Excel Discussion (Misc queries) 1 October 26th 08 01:21 AM
Borders and conditional formating Patrick C. Simonds Excel Worksheet Functions 5 January 19th 08 06:03 AM
Conditional Borders? MarcoPolo Excel Discussion (Misc queries) 1 January 9th 07 03:39 PM


All times are GMT +1. The time now is 09:35 PM.

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"