welcome to my space

Conditional Formating of cell ranges

  • Hello all,

    From D9 through IV9, I want only text that fits the following conditions:

    1. Must be the letter "C" or the letter "O" or blank.

    2. If either "C" or "O", then it has to be Capitalized.

    How would I do this?

    The person putting this information in those cells should not be able to change or delete the formula that makes this happen.

    Thanks in advance.


  • If you are interested in a VBA solution:

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Dim myArray()
    myArray = Array("a", "b", "d", "e", "f", "g", "h", "i", "j", "k", _
    "l", "m", "n", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z")
    Dim myRange As Range
    Set myRange = Worksheets("Sheet1").Range("D9:IV9")
    With myRange
    .Replace "c", "C"
    .Replace "o", "O"
    .Replace myArray, ""
    End With

    End Sub

    This works but is ugly. Maybe someone with more experience can clean it up a little.:frosty:


  • Maybe the attached will help?


  • Or may be this, so that only capitals can be entered.

    Select D9, go to Data Validation > Settings > Custom, then enter in the formula

    =EXACT(D9,UPPER(D9))

    then on the Input Message type in "Enter capital C or O only", then on the Error Alert type in "Enter upper case only"

    Then copy cell D9, select E9:IV9 Paste so that it applies to all your cells.







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Conditional Formating of cell ranges , Please add it free.