Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Thu, 5 Aug 2010 08:35:24 +0800, "ela" wrote:
Modifying your code a bit: ===================== Option Explicit Sub GreenPhrase() Dim s As String Dim c As Range Dim i As Long, j As Long s = InputBox("Which phrase to green?") j = Len(s) For Each c In Selection With c i = InStr(1, .Text, s) .Font.ColorIndex = xlAutomatic If i 0 Then .Characters(i, j).Font.Color = RGB(30, 255, 15) 'Selection.Interior.ColorIndex = [A1].Interior.ColorIndex End If End With Next c End Sub +++++++++++++++++++++++++++++ Is this modification making the code running faster? You will have to tell me when you run it against your data. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Trying To Append String Variable To Another String Variable | Excel Programming | |||
Create Variable Length String Dependent Upon Size List | Excel Programming | |||
How to find out the size of a variable-size array ? | Excel Programming | |||
setting a range variable equal to the value of a string variable | Excel Programming | |||
How do I convert an integer variable to a string variable? | Excel Programming |