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

Hi,

I keep getting an error stating it can't create the top line. It errors at
the LineStyle Continuous. I don't know why. What do I need to check?

With Range("L2")
.FormatConditions.Delete
.HorizontalAlignment = xlCenter
.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="=""""""Gross Up"""""""
.FormatConditions(1).Borders(xlRight).LineStyle = xlNone
With .FormatConditions(1).Borders(xlLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.FormatConditions(1).Borders(xlTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With .FormatConditions(1).Borders(xlBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End With
--
Thanks for your help,
Karen
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Conditional formatting

It should not make any difference, but out of curiosity, is Range("L1") a
merged cell?

"Karen53" wrote:

Hi,

I keep getting an error stating it can't create the top line. It errors at
the LineStyle Continuous. I don't know why. What do I need to check?

With Range("L2")
.FormatConditions.Delete
.HorizontalAlignment = xlCenter
.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="=""""""Gross Up"""""""
.FormatConditions(1).Borders(xlRight).LineStyle = xlNone
With .FormatConditions(1).Borders(xlLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.FormatConditions(1).Borders(xlTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With .FormatConditions(1).Borders(xlBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End With
--
Thanks for your help,
Karen

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Conditional formatting

Could also be a syntax problem:
Try xlEdgeTop, xlEdgeLeft, xlEdgeBottom
Se if you still get the error.

"Karen53" wrote:

Hi,

I keep getting an error stating it can't create the top line. It errors at
the LineStyle Continuous. I don't know why. What do I need to check?

With Range("L2")
.FormatConditions.Delete
.HorizontalAlignment = xlCenter
.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="=""""""Gross Up"""""""
.FormatConditions(1).Borders(xlRight).LineStyle = xlNone
With .FormatConditions(1).Borders(xlLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.FormatConditions(1).Borders(xlTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With .FormatConditions(1).Borders(xlBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End With
--
Thanks for your help,
Karen

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 333
Default Conditional formatting

Hi,

Thank you for your reply. I tried the xlEdgeLeft etc. but I still get an
error at the .linestyle = xlContinuous stating it can't process the line.

I did the same thing in another cell and it works perfectly. I see no
difference between the two except the condition.

Is there anything else I should check?

thanks
--

Karen


"JLGWhiz" wrote:

Could also be a syntax problem:
Try xlEdgeTop, xlEdgeLeft, xlEdgeBottom
Se if you still get the error.

"Karen53" wrote:

Hi,

I keep getting an error stating it can't create the top line. It errors at
the LineStyle Continuous. I don't know why. What do I need to check?

With Range("L2")
.FormatConditions.Delete
.HorizontalAlignment = xlCenter
.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="=""""""Gross Up"""""""
.FormatConditions(1).Borders(xlRight).LineStyle = xlNone
With .FormatConditions(1).Borders(xlLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.FormatConditions(1).Borders(xlTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With .FormatConditions(1).Borders(xlBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End With
--
Thanks for your help,
Karen

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 333
Default Conditional formatting

I got it. It looks like it had to do with the number of quotes on the
condition.

Thanks for your help!
--

Karen


"JLGWhiz" wrote:

Could also be a syntax problem:
Try xlEdgeTop, xlEdgeLeft, xlEdgeBottom
Se if you still get the error.

"Karen53" wrote:

Hi,

I keep getting an error stating it can't create the top line. It errors at
the LineStyle Continuous. I don't know why. What do I need to check?

With Range("L2")
.FormatConditions.Delete
.HorizontalAlignment = xlCenter
.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="=""""""Gross Up"""""""
.FormatConditions(1).Borders(xlRight).LineStyle = xlNone
With .FormatConditions(1).Borders(xlLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.FormatConditions(1).Borders(xlTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With .FormatConditions(1).Borders(xlBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End With
--
Thanks for your help,
Karen

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--different formatting depending on cell con Tammy S. Excel Discussion (Misc queries) 3 March 30th 09 08:11 PM
Formatting cells in a column with conditional formatting? shamor Excel Discussion (Misc queries) 8 May 19th 08 10:11 PM
Protect Cell Formatting including Conditional Formatting Mick Jennings Excel Discussion (Misc queries) 5 November 13th 07 05:32 PM
conditional Formatting based on cell formatting Totom Excel Worksheet Functions 3 January 20th 07 02:02 PM
Conditional Formatting that will display conditional data BrainFart Excel Worksheet Functions 1 September 13th 05 05:45 PM


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