Skip to content

Instantly share code, notes, and snippets.

@DuongAQ
Created February 7, 2018 04:49
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save DuongAQ/34287f2cfcbbbcc0459989abce3f9d5a to your computer and use it in GitHub Desktop.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'Hủy bỏ lệnh to màu cho vùng A1:Z1000
With Range("A1:Z1000").Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
'Thực hiện tô màu cho ô được chọn
With Target.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment