Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Creating Borders with a formula
I am trying to create a top border for a row evverytime
one of the column H is = 1. If anyone knows please post it or e-mail me at . Thanks, Jeff Fink |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Creating Borders with a formula
Put the following code behind the worksheet you wish to apply a top border
to a row when the vlaue in column H is set to a 1. The code is triggered by a change of cell selection and works by scanning column H from row1 until the last row where column H has a value. If the value in column H (current row) equals 1 then the entire row topborder is turned on, else turned off. Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim lstrow As Long Dim i As Long lstrow = Cells(Rows.Count, "H").End(xlUp).Row For i = 1 To lstrow With Rows(i).Borders(xlEdgeTop) If Range("H" & i).Value = 1 Then .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic Else .LineStyle = xlNone End If End With Next i End Sub Cheers Nigel "Jeff Fink" wrote in message ... I am trying to create a top border for a row evverytime one of the column H is = 1. If anyone knows please post it or e-mail me at . Thanks, Jeff Fink |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Creating borders via Conditional Formatting | Excel Discussion (Misc queries) | |||
Transparent Cell Borders For Formula Cells? | Excel Discussion (Misc queries) | |||
Borders on cells included in formula while editing | Setting up and Configuration of Excel | |||
Cell borders with formula edits | Excel Discussion (Misc queries) | |||
Creating cells with Diagonal borders | Excel Discussion (Misc queries) |