업무 자동화/VBA VB.Net Code
Highlight Selected Column
ToolBOX01
2023. 1. 9. 14:13
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/
How to highlight active row and column in Excel
3 ways to dynamically highlight the row and/or column of a selected cell in Excel.
www.ablebits.com
오피스튜터 - 강좌: Worksheet _change 이벤트 핸들러 설계하기
오피스튜터 - 강좌: Worksheet _change 이벤트 핸들러 설계하기
www.officetutor.co.kr
참고 사이트