Search words in Sheet and apply bold style

AsifShah

Board Regular
Joined
Feb 12, 2021
Messages
70
Office Version
  1. 2016
  2. 2013
Platform
  1. Windows
Hello Everyone
I hope everyone fine.
Please help me on bold few words in sheet1.range("A1") on Criteria
Criteria = textbox1.text & " " & textbox2 & " " & textbox3

i'm making a certificate in which student name or some other information will show in bold style.
Sheet1.range("a1") value

This is to certify that Mr Muhammad Abbas S/O Miraj Dm By caste Abro . We proudly certify that the student bears an excellent moral and character. During her entire academic session she has neither displayed any violence nor anti-social behaviour towards others.

Same like bold Name, Father name and caste
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Like this?
VBA Code:
Sub test()
  Dim lRow As Long, i As Long
  lRow = Cells(Rows.Count, "A").End(xlUp).Row
  Application.ScreenUpdating = False
  For i = 1 To lRow
    sToFind = textbox1.text & " " & textbox2 & " " & textbox3
    iSeek = InStr(1, Cells(i, "A").Value, sToFind)
    Do While iSeek > 0
      Cells(i, "A").Characters(iSeek, Len(sToFind)).Font.Bold = True
      iSeek = InStr(iSeek + 1, Cells(i, "A").Value, sToFind)
    Loop
  Next
  Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,092
Messages
6,123,063
Members
449,090
Latest member
fragment

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top