PC Review


Reply
Thread Tools Rate Thread

Autoformat screws up with FormatConditions?

 
 
bentod
Guest
Posts: n/a
 
      16th Jan 2008
I have a dynamic named range. The range has autoformatting (List 2).
When I add to the range, my code will add some conditional formatting
to the row if it needs it.

Unfortunately, once a new row is added to the range, the conditional
formatting works fine, but if I trigger autoformatting to run, my
spreadsheet looks all kinds of freaked out. Like it's in a state of
color flux.

Here's my (cheesy) code:

'-----------------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)

Application.ScreenUpdating = False

[I2].Activate
With Range([I2], [I65536].End(xlUp)).Offset(0, -8).Resize(, 10)
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="=
$I2=""N"""
.FormatConditions(1).Interior.ColorIndex = 10
.FormatConditions(1).Font.ColorIndex = 2
.FormatConditions.Add Type:=xlExpression, Formula1:="=
$I2=""X"""
.FormatConditions(2).Interior.ColorIndex = 19
.FormatConditions(2).Font.ColorIndex = 1
End With

Range("DataFormat").Select
Selection.AutoFormat Format:=xlRangeAutoFormatList2, Number:=False,
Font:= _
False, Alignment:=False, Border:=True, Pattern:=True,
Width:=False

Application.ScreenUpdating = True

End Sub
'-------------------------------------------------------

Thanks, Todd
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FormatConditions Shawn Microsoft Excel Programming 1 30th Jan 2010 04:52 AM
FormatConditions Norbert Meiss Microsoft Access Form Coding 0 6th Sep 2009 09:55 AM
AutoFormat v. AutoFormat As You Type =?Utf-8?B?TWFybmVl?= Microsoft Word Document Management 10 1st Sep 2007 04:24 AM
FormatConditions VBA Bug? DaveCrowley Microsoft Excel Programming 7 24th May 2006 09:52 PM
FormatConditions(1).Formula1 =?Utf-8?B?U3RlZmk=?= Microsoft Excel Programming 9 17th Feb 2006 10:37 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:49 AM.