返回列表 上一主題 發帖

[發問] 如何才能找尋所要的資料並在儲存格塗色?

本帖最後由 oobird 於 2011-4-27 15:01 編輯

加上右側打勾
  1. Sub yy()
  2. With Application.ReplaceFormat.Interior
  3.         .ColorIndex = 3
  4.     End With
  5.    Cells.Replace What:="john", Replacement:="=1/0", ReplaceFormat:=True
  6.    With Cells.SpecialCells(xlCellTypeFormulas, 16)
  7.    .Value = "john"
  8.    .Offset(, 1) = "√"
  9.    End With
  10. End Sub
複製代碼

TOP

每一帖要比對的位置都不一樣
不知該回覆哪一帖
最後一帖的:
Sub module1()
Dim yy As Range, data As Range
For Each yy In Range([a1], [a65535].End(3))
Set c = [b:b].Find(yy, , , 1)
If Not c Is Nothing Then
           If data Is Nothing Then
           Set data = c
        Else
          Set data = Union(data, c)
        End If
     End If
Next
    If Not data Is Nothing Then
    With data
        .Interior.ColorIndex = 3
        .Offset(, 1) = "V"
    End With
    End If
End Sub

TOP

        靜思自在 : 時時好心就是時時好日。
返回列表 上一主題