Link to home
Start Free TrialLog in
Avatar of tbaseflug
tbaseflugFlag for United States of America

asked on

Conditional format based upon value - in VBA

I have a series of cells with values like:

{i}99000
97110
{i}85025

What I would like to do is to conditionally format based upon the presence of {i} - additionally, would like to remove the {i} - if I could do it in a cell formula/conditional formatting great - if not, in VBA?
ASKER CERTIFIED SOLUTION
Avatar of Member_2_6169280
Member_2_6169280
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Patrick Matthews
tbaseflug,

It would be useful to see some sample data and/or a sample file.  EE now allows you to directly upload files to your question.

Please be advised that once you upload a file, it can be publicly accessed, and that it may not be possible to fully and permanently delete it.  The file may also be indexed by the major search engines.

Therefore, be very careful about posting proprietary, confidential, or other sensitive information.  If necessary, use "fake" and/or obfuscated data in your sample.

Please note that at present EE restricts uploads to certain file types.  If your file type does not match those in the list, you can use http://www.ee-stuff.com instead, which is not officially an EE site, but is run by people connected to EE.

Patrick
Avatar of tbaseflug

ASKER

royhsiao - this seems to work - but is there anyway to do it on workbook open, etc.?
OK - I have it working on workbook open - how do I put the font in red and the background just normal?
Please try this out.
Sub Macro3()

    With Application.ReplaceFormat.Font
        .FontStyle = "Bold"
        .Size = 12
        .Superscript = False
        .Subscript = False
        .Color = -16776961
        .TintAndShade = 0
    End With
    Cells.Replace What:="{i}", Replacement:=" ", LookAt:=xlPart, SearchOrder _
        :=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=True
End Sub

Open in new window