Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

conditional macro or formatting 1

Status
Not open for further replies.

dinzana

Programmer
Nov 21, 2002
118
US
Hello All,

I am trying to format a cell to be a certain color and have a double line border at the top of the cell if the value of another cell is ='Total'. I have tried conditional formatting but there are only single line borders. Here is the code that is generated when I record a macro to border with double lines. I just need to know how to apply the condition for a cell value.

thanks so much in advance.

dinzana

<code>

Sub borderDoubleLine()
'
' borderDoubleLine Macro
' Macro recorded 6/18/2008 by Mobile Software
'

'
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
Selection.Borders(xlEdgeTop).LineStyle = xlNone
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlDouble
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlEdgeRight).LineStyle = xlNone
End Sub

</code>
 



Did you try the Conditional Format suggestion that I made in your Forum68 thread?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Thanks Skip, it worked like a charm! You're a Star!

dinzana
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top