Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Replace a format of a part of a cell
Any idea how to have just a single word or part of text of a cell for example
"Amount" wherever occurring on the sheet be converted to be in red colored font? -- Best Regards, Faraz |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Replace a format of a part of a cell
Hi,
Try this Private Sub Worksheet_Change(ByVal Target As Range) If InStr(UCase(Target.Value), "AMOUNT") = 0 Then Exit Sub With Target.Characters(Start:=InStr(UCase(Target.Value) , "AMOUNT"), Length:=6).Font .ColorIndex = 3 End With End Sub Mike "Faraz A. Qureshi" wrote: Any idea how to have just a single word or part of text of a cell for example "Amount" wherever occurring on the sheet be converted to be in red colored font? -- Best Regards, Faraz |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Replace a format of a part of a cell
or if you wanted to check an already populated sheet try this
Sub missive() For Each c In ActiveSheet.UsedRange If InStr(1, c.Value, "AMOUNT", vbTextCompare) 0 Then With c.Characters(Start:=InStr(1, c.Value, _ "AMOUNT", vbTextCompare), Length:=6).Font .ColorIndex = 3 End With End If Next End Sub Mike "Mike H" wrote: Hi, Try this Private Sub Worksheet_Change(ByVal Target As Range) If InStr(UCase(Target.Value), "AMOUNT") = 0 Then Exit Sub With Target.Characters(Start:=InStr(UCase(Target.Value) , "AMOUNT"), Length:=6).Font .ColorIndex = 3 End With End Sub Mike "Faraz A. Qureshi" wrote: Any idea how to have just a single word or part of text of a cell for example "Amount" wherever occurring on the sheet be converted to be in red colored font? -- Best Regards, Faraz |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Replace a format of a part of a cell
XClent!
-- Best Regards, Faraz "Mike H" wrote: or if you wanted to check an already populated sheet try this Sub missive() For Each c In ActiveSheet.UsedRange If InStr(1, c.Value, "AMOUNT", vbTextCompare) 0 Then With c.Characters(Start:=InStr(1, c.Value, _ "AMOUNT", vbTextCompare), Length:=6).Font .ColorIndex = 3 End With End If Next End Sub Mike "Mike H" wrote: Hi, Try this Private Sub Worksheet_Change(ByVal Target As Range) If InStr(UCase(Target.Value), "AMOUNT") = 0 Then Exit Sub With Target.Characters(Start:=InStr(UCase(Target.Value) , "AMOUNT"), Length:=6).Font .ColorIndex = 3 End With End Sub Mike "Faraz A. Qureshi" wrote: Any idea how to have just a single word or part of text of a cell for example "Amount" wherever occurring on the sheet be converted to be in red colored font? -- Best Regards, Faraz |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Replace a format of a part of a cell
Glad I could help
"Faraz A. Qureshi" wrote: XClent! -- Best Regards, Faraz "Mike H" wrote: or if you wanted to check an already populated sheet try this Sub missive() For Each c In ActiveSheet.UsedRange If InStr(1, c.Value, "AMOUNT", vbTextCompare) 0 Then With c.Characters(Start:=InStr(1, c.Value, _ "AMOUNT", vbTextCompare), Length:=6).Font .ColorIndex = 3 End With End If Next End Sub Mike "Mike H" wrote: Hi, Try this Private Sub Worksheet_Change(ByVal Target As Range) If InStr(UCase(Target.Value), "AMOUNT") = 0 Then Exit Sub With Target.Characters(Start:=InStr(UCase(Target.Value) , "AMOUNT"), Length:=6).Font .ColorIndex = 3 End With End Sub Mike "Faraz A. Qureshi" wrote: Any idea how to have just a single word or part of text of a cell for example "Amount" wherever occurring on the sheet be converted to be in red colored font? -- Best Regards, Faraz |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
replace part text in a cell | Excel Discussion (Misc queries) | |||
Find & Replace part of cell contents | Excel Programming | |||
REPLACE PART OF CELL WITH FORMATTED TEXT | Excel Worksheet Functions | |||
Macro to evaluate a cell and replace one part of the formula | Excel Programming | |||
Search & Replace Formatting for part of cell | Excel Programming |