PC Review


Reply
Thread Tools Rate Thread

Conditional Formatting via VBA in Excel 2007

 
 
MrWinelover
Guest
Posts: n/a
 
      24th Apr 2008
New since version 2007 of Excel is the posibility to have conditional
formatting based on cells with specific text beginning with some predifined
text.
This is done by selecting Conditional Formatting (Home tab) > Manage
rules... Select "New Rule..." in the "Conditional Formatting Rules Manager"
window. In the "Newt Formatting Rule" windows choose the rule type "Format
only cell that contain" and edit the rule description by choosing "Specific
Text" in the left drop-dowm box and "beginning with" in the right drop-down
box. Give the text to check on in the textfield and click "OK"

Now the same conditional Formatting should be added via VBA but here's my
problem. It seems there is no information on the internet already.

Can someone help me further?
--
MrWinelover...
 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      24th Apr 2008
With Selection
.FormatConditions.Add Type:=xlTextString, _
String:="apple", _
TextOperator:=xlBeginsWith
.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With .FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 255
.TintAndShade = 0
End With
.FormatConditions(1).StopIfTrue = False
End With


--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"MrWinelover" <(E-Mail Removed)> wrote in message
news:4205053B-99D7-4A52-B4BF-(E-Mail Removed)...
> New since version 2007 of Excel is the posibility to have conditional
> formatting based on cells with specific text beginning with some
> predifined
> text.
> This is done by selecting Conditional Formatting (Home tab) > Manage
> rules... Select "New Rule..." in the "Conditional Formatting Rules
> Manager"
> window. In the "Newt Formatting Rule" windows choose the rule type "Format
> only cell that contain" and edit the rule description by choosing
> "Specific
> Text" in the left drop-dowm box and "beginning with" in the right
> drop-down
> box. Give the text to check on in the textfield and click "OK"
>
> Now the same conditional Formatting should be added via VBA but here's my
> problem. It seems there is no information on the internet already.
>
> Can someone help me further?
> --
> MrWinelover...



 
Reply With Quote
 
MrWinelover
Guest
Posts: n/a
 
      24th Apr 2008
Thanks Bob for the quick en working reply
--
MrWinelover...


"Bob Phillips" wrote:

> With Selection
> .FormatConditions.Add Type:=xlTextString, _
> String:="apple", _
> TextOperator:=xlBeginsWith
> .FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
> With .FormatConditions(1).Interior
> .PatternColorIndex = xlAutomatic
> .Color = 255
> .TintAndShade = 0
> End With
> .FormatConditions(1).StopIfTrue = False
> End With
>
>
> --
> ---
> HTH
>
> Bob
>
>
> (there's no email, no snail mail, but somewhere should be gmail in my addy)
>
>
>
> "MrWinelover" <(E-Mail Removed)> wrote in message
> news:4205053B-99D7-4A52-B4BF-(E-Mail Removed)...
> > New since version 2007 of Excel is the posibility to have conditional
> > formatting based on cells with specific text beginning with some
> > predifined
> > text.
> > This is done by selecting Conditional Formatting (Home tab) > Manage
> > rules... Select "New Rule..." in the "Conditional Formatting Rules
> > Manager"
> > window. In the "Newt Formatting Rule" windows choose the rule type "Format
> > only cell that contain" and edit the rule description by choosing
> > "Specific
> > Text" in the left drop-dowm box and "beginning with" in the right
> > drop-down
> > box. Give the text to check on in the textfield and click "OK"
> >
> > Now the same conditional Formatting should be added via VBA but here's my
> > problem. It seems there is no information on the internet already.
> >
> > Can someone help me further?
> > --
> > MrWinelover...

>
>
>

 
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
Conditional Formatting in Excel 2007 didi Microsoft Excel Discussion 1 19th Oct 2010 01:41 PM
conditional formatting in Excel 2007 John Keith Microsoft Excel Misc 1 19th Jul 2009 09:22 AM
Conditional Formatting in Excel 2007 Rick Bennett Microsoft Excel Worksheet Functions 3 6th Mar 2009 01:30 AM
Conditional Formatting Excel 2007 RFJ Microsoft Excel Discussion 2 29th Jun 2007 06:19 PM
Conditional Formatting in Excel 2007 =?Utf-8?B?SmVzc2ljYQ==?= Microsoft Excel Misc 0 23rd Aug 2006 03:34 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:55 PM.