Active cell Selection

'Menyorot baris dan kolom pada cell aktif dengan warna
Sub activecell_seleksi
 Dim RngRow          As Range
    Dim RngCol          As Range
    Dim RngFinal        As Range
    Dim Row             As Long
    Dim Col             As Long
   
    Cells.Interior.ColorIndex = xlNone
    'Range(ActiveCell, ActiveCell.End(xlDown)).Select
   
    'Row = Target.Row
    Row = Target.Row
    Col = Target.Column
   
    Set RngRow = Range("A" & Row, Target.End(xlToRight))
    Set RngCol = Range(Cells(1, Col), Target)
    Set RngFinal = Union(RngRow, RngCol)
   
    RngFinal.Interior.ColorIndex = 6

End Sub

Komentar

Postingan Populer