Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Conditional Formatting via VBA in Excel 2007

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...
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Conditional Formatting via VBA in Excel 2007

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" wrote in message
...
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...



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Conditional Formatting via VBA in Excel 2007

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" wrote in message
...
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
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
conditional formatting in excel 2007 Lofty Excel Worksheet Functions 1 January 15th 10 02:16 PM
Conditional Formatting Excel 2007 Emece Excel Discussion (Misc queries) 2 December 3rd 08 03:17 PM
Conditional formatting in Excel 2007 Mike Tordoff Excel Discussion (Misc queries) 3 May 19th 07 07:20 AM
Excel 2007 Conditional Formatting DSmurf Excel Programming 2 November 21st 06 10:59 PM
Excel 2007 Conditional Formatting The Peasant King Excel Programming 0 July 6th 06 04:22 PM


All times are GMT +1. The time now is 10:14 PM.

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

About Us

"It's about Microsoft Excel"