Skip to content

Instantly share code, notes, and snippets.

@DuongAQ
Created March 20, 2018 08:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DuongAQ/20500c361fba0227a4435c79f87def2e to your computer and use it in GitHub Desktop.
Save DuongAQ/20500c361fba0227a4435c79f87def2e to your computer and use it in GitHub Desktop.
Sub Phan_Mang_Data()
Dim lr As Long 'Biến dòng cuối
Dim area As Range 'Biến mảng chi tiết
Dim sh As Worksheet 'Biến Sheet
Set sh = ActiveSheet 'Tại sheet đang sử dụng
'Tô màu xanh cho các mảng trong cột A
lr = sh.Cells(Rows.Count, 1).End(xlUp).Row 'Xác định dòng cuối cột A
For Each area In sh.Range("A2:A" & lr).SpecialCells(xlCellTypeConstants).Areas
area.Interior.Color = vbGreen 'Tô màu xanh
Next area
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment