Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / September 2007

Tip: Looking for answers? Try searching our database.

Conditional formatting

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Karen53 - 26 Sep 2007 19:42 GMT
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
Signature

Thanks for your help,
Karen

JLGWhiz - 27 Sep 2007 03:35 GMT
It should not make any difference, but out of curiosity, is Range("L1") a
merged cell?

> Hi,
>
[quoted text clipped - 23 lines]
>         End With
>     End With
JLGWhiz - 27 Sep 2007 03:45 GMT
Could also be a syntax problem:
Try xlEdgeTop, xlEdgeLeft, xlEdgeBottom
Se if you still get the error.

> Hi,
>
[quoted text clipped - 23 lines]
>         End With
>     End With
Karen53 - 27 Sep 2007 19:39 GMT
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
Signature


Karen

> Could also be a syntax problem:
> Try xlEdgeTop, xlEdgeLeft, xlEdgeBottom
[quoted text clipped - 27 lines]
> >         End With
> >     End With
Karen53 - 27 Sep 2007 20:03 GMT
I got it.  It looks like it had to do with the number of quotes on the
condition.

Thanks for your help!
Signature


Karen

> Could also be a syntax problem:
> Try xlEdgeTop, xlEdgeLeft, xlEdgeBottom
[quoted text clipped - 27 lines]
> >         End With
> >     End With
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.