Hi,
Is there any macro to find a string in a Excel cell and make that particular string as bold
Hi,
Is there any macro to find a string in a Excel cell and make that particular string as bold
Hi,
Is the string the only characters in the cell or is the string a subset of all the cell's characters?
And are you looking at a specific cell or finding the string somewhere in a range of cells?
Richard Buttrey
RIP - d. 06/10/2022
If any of the responses have helped then please consider rating them by clicking the small star iconbelow the post.
Assuming that your data are in column A, type the string that you want in C1 and run this code.
![]()
Sub ChangeColour() Dim Cell As Range QueryTerm = Range("C1").Value For Each Cell In Range(Cells(1, 1), Cells(Rows.Count, 1).End(xlUp)) If InStr(UCase(Cell.Value), UCase(QueryTerm)) > 0 Then Cell.Characters(Start:=1, Length:=InStr(UCase(Cell.Value), UCase(QueryTerm)) - 1).Font.Color = RGB(0, 0, 0) Cell.Characters(Start:=InStr(UCase(Cell.Value), UCase(QueryTerm)), Length:=Len(QueryTerm)).Font.Color = RGB(255, 0, 0) Cell.Characters(Start:=InStr(UCase(Cell.Value), UCase(QueryTerm)) + Len(QueryTerm) + 1, Length:=Len(Cell.Value) - InStr(UCase(Cell.Value), UCase(QueryTerm)) - Len(QueryTerm)).Font.Color = RGB(0, 0, 0) Else Cell.Characters(Start:=1, Length:=Len(Cell.Value)).Font.Color = RGB(0, 0, 0) End If Next Cell End Sub
Regards
Fotis.
-This is my Greek whisper to Europe.
--Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.
Advanced Excel Techniques: http://excelxor.com/
--KISS(Keep it simple Stupid)
--Bring them back.
---See about Acropolis of Athens.
--Visit Greece.
For example
in a cell if i have text like " Hi this is kiran"
i just want to make text "kiran" as bold and rest of them should be normal before that i need to search this string "kiran" in all the cells in the excel sheet and should make it as bold
is this possible
Any help ????
Doesn't suggestion of post#3, works for you?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks