tbaseflug
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?
{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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
royhsiao - this seems to work - but is there anyway to do it on workbook open, etc.?
ASKER
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
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