View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Cathy Cathy is offline
external usenet poster
 
Posts: 104
Default Formula Conditional Formating

I need VBA to perform some conditional formatting on a spreadsheet that is
overlaid by ACCESS. I can get the formula to work in the tradional
conditional formatting by using the Formula: =RIGHT($E1,5)='Total', then
changing the format to Bold/Italic. I have tried numerous ways to make it
work in VBA, but I'm afraid I just don't understand enough about VBA to
figure it out. Here's my latest attempt:

Range("E1:K61000").Select
Selection.FormatConditions.Add Type:=xlExpression, _
Formula1:="=RIGHT($E1,5)='Total'"
Selection.FormatConditions(1).Bold = True
Selection.FormatConditions(1).Italic = True

It keeps rejecting the second & third line of code. Any suggestions?

Thank you in advance,
Cathy