hoahuongduong1986
Thành viên thường trực
![](/diendan/data/PhoToDanhHieu/gold.gif)
![](/diendan/data/PhoToDanhHieu/gold.gif)
![](/diendan/data/PhoToDanhHieu/gold.gif)
![](/diendan/data/PhoToDanhHieu/gold.gif)
- Tham gia
- 14/11/18
- Bài viết
- 346
- Được thích
- 40
Em có đoan code này trên mạng để chuyển màu chữ. Nhưng khi em Add vào nó hiệu lực ở tất cả các FIle Excel. Làm sao đẻ nó chỉ thực hiện cho File em đang làm thôi ạ. Em cảm ơn ạ.
Sub StartBlink()
Dim xCell As Range
Dim xTime As Variant
Set xCell = Range("A6")
With ThisWorkbook.Worksheets("Bao cao").Range("A6").Font
If xCell.Font.Color = vbRed Then
xCell.Font.Color = vbWhite
Else
xCell.Font.Color = vbRed
End If
End With
xTime = Now + TimeSerial(0, 0, 1)
Application.OnTime xTime, "'" & ThisWorkbook.Name & "'!StartBlink", , True
End Sub
Sub StartBlink()
Dim xCell As Range
Dim xTime As Variant
Set xCell = Range("A6")
With ThisWorkbook.Worksheets("Bao cao").Range("A6").Font
If xCell.Font.Color = vbRed Then
xCell.Font.Color = vbWhite
Else
xCell.Font.Color = vbRed
End If
End With
xTime = Now + TimeSerial(0, 0, 1)
Application.OnTime xTime, "'" & ThisWorkbook.Name & "'!StartBlink", , True
End Sub