Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
conditional formatting in excel 2007 | Excel Worksheet Functions | |||
Conditional Formatting Excel 2007 | Excel Discussion (Misc queries) | |||
Conditional formatting in Excel 2007 | Excel Discussion (Misc queries) | |||
Excel 2007 Conditional Formatting | Excel Programming | |||
Excel 2007 Conditional Formatting | Excel Programming |