Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
if in cell(a1).value = "1544*". and in cell(a2).value = "4144".
How to write syntax if cell value containing character "*", then only "*" will become red in colour and other character of the cell will remain as it is. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Nilesh,
Interesting question. Will every cell that contains the * be 5 characters in length? JF On 27 Nov, 15:51, Nilesh Bhuvad wrote: if in cell(a1).value = "1544*". and in cell(a2).value = "4144". How to write syntax if cell value containing character "*", then *only "*" will become red in colour and other character of the cell will remain as it is. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub Highlight_Word()
Dim rng As Range Dim Cell As Range Dim start_str As Integer On Error GoTo endit Mylen = Len("*") Set rng = ActiveSheet.UsedRange rng.Cells.Font.ColorIndex = 0 For Each Cell In rng start_str = InStr(Cell.Value, "*") If start_str Then Cell.Characters(start_str, Mylen).Font.ColorIndex = 3 End If Next Cell endit: End Sub Will color only the first occurrence of * in a cell Gord Dibben MS Excel MVP On Thu, 27 Nov 2008 07:51:27 -0800, Nilesh Bhuvad wrote: if in cell(a1).value = "1544*". and in cell(a2).value = "4144". How to write syntax if cell value containing character "*", then only "*" will become red in colour and other character of the cell will remain as it is. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
Call macro stored in Excel workbook from Outlook's macro | Excel Programming | |||
Need syntax for RUNning a Word macro with an argument, called from an Excel macro | Excel Programming | |||
translate lotus 1-2-3 macro into excel macro using excel 2000 | Excel Programming | |||
Excel Macro Issue Trying to autorun Macro Upon Opening Worksheet | Excel Programming |