Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Autoformat screws up with FormatConditions?

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
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
sorting screws up referencing Andrei Excel Discussion (Misc queries) 0 March 13th 08 03:36 PM
What is the parameter for FormatConditions? J@Y Excel Programming 2 May 29th 07 05:21 PM
Is this a joke or Microsoft screws up again? John Smith Excel Programming 1 December 19th 06 02:58 AM
FormatConditions VBA Bug? DaveCrowley Excel Programming 7 May 24th 06 09:52 PM
FormatConditions(1).Formula1 Stefi Excel Programming 9 February 17th 06 10:37 AM


All times are GMT +1. The time now is 11:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"