I have many rows, column A and Column B each have detailed SQL statements which are concatanated into one statment in Column C. We would like to be able to Bold the part of Column C which was in Column A. There are hundreds of rows, could be done but....
I found some code in in thread68-538417 which works but only for the prompted text and then the entire worksheet.
Anyone care to see if this can be modified? I have never used VB in Excel.
Here is the sample I found if it offers inspiration.
I found some code in in thread68-538417 which works but only for the prompted text and then the entire worksheet.
Anyone care to see if this can be modified? I have never used VB in Excel.
Here is the sample I found if it offers inspiration.
Code:
Sub ColText()
Dim i As Long
Dim j As Integer
Dim k As Integer
Dim num As Long
Dim ans As String
Dim str As String
ans = InputBox("What string do you want to find")
i = Application.WorksheetFunction.CountIf(ActiveSheet.UsedRange, "*" & ans & "*")
j = Len(ans)
Application.ScreenUpdating = False
For num = 1 To i
Cells.Find(What:=ans, After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlPart, MatchCase:=False, SearchFormat:=False).Activate
k = Application.WorksheetFunction.Find(ans, ActiveCell)
With ActiveCell.Characters(Start:=k, Length:=j).Font
.ColorIndex = 4
End With
Cells.FindNext(After:=ActiveCell).Activate
Next num
End Sub