Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Dear all,
I am trying to highlight all the same strings in one Excel cell. For example, if the following text in one Excel cell, Wish you all a wonderful wonderful weekend! Using Gord Dibben's macro posted on Sep 19 2006 in this group (Please see the following for details), only the first wonderful will be highlighted. Could someone share your expertise to let me know how to highlight the second wonderful, i.e., all the same strings in one cell? Many thanks! .....Cheng ------------------------------------ Option Compare Text Sub Highlight_Word() Dim rng As Range Dim cell As Range Dim start_str As Integer On Error GoTo endit myword = InputBox("Enter the search string ") If myword = "" Then Exit Sub Mylen = Len(myword) Set rng = ActiveSheet.UsedRange rng.Cells.Font.ColorIndex = 0 For Each cell In rng start_str = InStr(cell.Value, myword) If start_str Then cell.Characters(start_str, Mylen).Font.ColorIndex = 3 End If Next cell endit: End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Splitting Text strings in one cell | Excel Discussion (Misc queries) | |||
How to find number of pairs of strings from list of strings? | Excel Worksheet Functions | |||
Highlight cells with ctrl-click but only un-highlight one cell | Excel Discussion (Misc queries) | |||
Compare cells/columns and highlight matching text strings | Excel Worksheet Functions | |||
Separating strings into different columns from one cell | Excel Worksheet Functions |