MÃ VBA EXCEL GIÓNG HÀNG CỘT
Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
'Update 20140318 https://quantrimang.com/cach-tu-dong-to-mau-hang-cot-trong-excel-164634
Static xRow
Static xColumn
If xColumn <> "" Then
With Columns(xColumn).Interior
.ColorIndex = xlNone
End With
With Rows(xRow).Interior
.ColorIndex = xlNone
End With
End If
pRow = Selection.Row
pColumn = Selection.Column
xRow = pRow
xColumn = pColumn
With Columns(pColumn).Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
With Rows(pRow).Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
End Sub
Comments
Post a Comment