How can I find and format specific cells automatically in Excel?
I format lengthy spreadsheets frequently and would like to know if it's
possible to find all cells with specific text (say, "Q*") and then format all of those cells to a specific color and bold font. I'd like to accomplish this automatically, if possible. Help! |
This is an example. This code looks at the first 10X10 cells for the
occurance of the word "treasure". If the word is found, then the format of that cell is changed. You can adapt this for your use. Sub markit() Dim t As String Dim t2 As String t2 = "treasure" For i = 1 To 10 For j = 1 To 10 t = Cells(i, j) If InStr(t, t2) 0 Then Cells(i, j).Select With Selection.Font .FontStyle = "Bold" .ColorIndex = 6 End With End If Next j Next i End Sub -- Gary's Student "Amy" wrote: I format lengthy spreadsheets frequently and would like to know if it's possible to find all cells with specific text (say, "Q*") and then format all of those cells to a specific color and bold font. I'd like to accomplish this automatically, if possible. Help! |
All times are GMT +1. The time now is 03:10 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com