반응형
Application.ScreenUpdating = False
If Target.Cells.Count > 1 Then Exit Sub
'// Clear the color of all cells
Dim lastColumn As Integer
lastColumn = Cells(15, Columns.Count).End(xlToLeft).Column
Dim lasRow As Integer
lasRow = Cells(Rows.Count, 16).End(xlUp).Row
Range("A16:XFD1048576").Interior.ColorIndex = 0
If Not Intersect(Target, Range(Cells(16, "A"), Cells(lasRow, lastColumn))) Is Nothing Then
With Target
'// Highlight row of the selected cell
.EntireRow.Interior.ColorIndex = 38
'// Highlight column of the selected cell
'//.EntireColumn.Interior.ColorIndex = 24
End With
End If
프로그램 동작 화면
https://www.ablebits.com/office-addins-blog/highlight-active-row-column-excel/
참고 사이트
'VBA Code' 카테고리의 다른 글
진행률 표시 (0) | 2023.01.19 |
---|---|
with ~End With (0) | 2023.01.12 |
문자열 응용 하기 (0) | 2023.01.01 |
Cells 값 비교 하기 (0) | 2022.12.16 |
엑셀 셀 선택시 열,행 색상으로 표시하기 (0) | 2022.12.14 |