Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 06-02-2012, 03:44 AM
tinfanide tinfanide is offline Any equiv. in Conditional Formatting??? Windows 7 64bit Any equiv. in Conditional Formatting??? Office 2010 32bit
Expert
Any equiv. in Conditional Formatting???
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default Any equiv. in Conditional Formatting???

Code:
''' check if each cell in selection does not contain specific words


Dim oCell As Excel.Range
For Each oCell In Selection.Cells

    If InStr(1, oCell.Value, "Teacher", vbTextCompare) = 0 And InStr(1, oCell.Value, "Tutor", vbTextCompare) = 0 Then
        oCell.Interior.ColorIndex = 3
    End If

Next oCell

'''
Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Columns("A").Cells) Is Nothing Then
        If InStr(1, Target.Value, "Teacher", vbTextCompare) = 0 And InStr(1, Target.Value, "Tutor", vbTextCompare) = 0 Then
            Target.Interior.ColorIndex = 3
        Else
            Target.Interior.ColorIndex = 0
        End If
    End If
End Sub
'''
The above sets of codes do not auto check Column A every time.
I would prefer Conditional Formatting. But how can I do that like Conditional Formatting?
Can I do it without VBA?
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Any equiv. in Conditional Formatting??? Conditional Formatting. Laurie B. Excel 6 04-09-2012 05:01 PM
Conditional formatting zanat0s Excel 4 01-20-2012 03:30 AM
Any equiv. in Conditional Formatting??? Conditional formatting with AND, OR Lucky Excel 2 10-03-2011 11:41 PM
Any equiv. in Conditional Formatting??? Conditional Formatting namedujour Excel 3 08-25-2011 01:46 PM
Any equiv. in Conditional Formatting??? help with conditional formatting Snvlsfoal Excel 3 07-03-2011 11:55 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:23 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft