+ Reply to Thread
Results 1 to 3 of 3

How can I find and format specific cells automatically in Excel?

Hybrid View

  1. #1
    Amy
    Guest

    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!

  2. #2
    Gary's Student
    Guest

    RE: How can I find and format specific cells automatically in Excel?

    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!


  3. #3
    Gary's Student
    Guest

    RE: How can I find and format specific cells automatically in Excel?

    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!


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1