luytrelang
Thành viên mới

- Tham gia
- 7/2/16
- Bài viết
- 3
- Được thích
- 0
Bạn tham khảo:Em có ví dụ này nhờ A/C xem dùm em nhé!
Tìm kiếm giá trì và tô màu ô. Câu hỏi cụ thể trong file đính kèm!![]()
Private Sub CommandButton1_Click()
Dim ws As Worksheet
Set ws = Sheets(1)
With ws.Cells
Set c = .Find(txtvalue.Value, LookIn:=xlValues, LookAt:=xlWhole)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.Interior.Color = vbGreen
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
Else
MsgBox ("Khong tim thay")
End If
End With
End Sub
Em có ví dụ này nhờ A/C xem dùm em nhé!
Tìm kiếm giá trì và tô màu ô. Câu hỏi cụ thể trong file đính kèm!![]()
Sub tim_tomau()
Dim Rng As Range, Cll As Range, DK As String, Haha As Boolean
DK = "OK"
Set Rng = Range("A2:G20")
Rng.Interior.ColorIndex = 0
For Each Cll In Rng
If UCase(Cll) = DK Then
Cll.Interior.ColorIndex = 4
Haha = True
End If
Next
If Haha = False Then MsgBox "Khong tim thay", , "GPE"
Set Rng = Nothing
End Sub