메인 컨텐츠로 가기

Excel에서 필터링 된 경우 열 또는 열 머리글을 강조 표시하는 방법은 무엇입니까?

열이 여러 개인 테이블의 경우 필터링 된 열에 대한 명확한 기호가 없기 때문에 한눈에 필터링 된 열을 찾기가 쉽지 않습니다. 표. 필터링 된 열을 테이블에서 두드러지게하려면이 문서의 방법이 도움이 될 수 있습니다.

VBA 코드로 필터링 된 경우 열 머리글 또는 전체 열 강조 표시


VBA 코드로 필터링 된 경우 열 머리글 또는 전체 열 강조 표시

아래 스크린 샷과 같이 전체 열을 강조 표시하거나이 열이 테이블 범위에서 필터링 된 경우 열 머리글 만 강조 표시해야합니다. 다음 VBA 코드를 적용하십시오.

1. 누르세요 다른 + F11 키를 눌러 응용 프로그램 용 Microsoft Visual Basic 창.

2. Microsoft Visual Basic for Applications 창에서 끼워 넣다 > 모듈. 그런 다음 아래 VBA 코드를 모듈 창에 복사하십시오.

VBA 코드 : 열이 필터링 된 경우 열 머리글 강조

Sub HighLightTitle()
'Updated by Extendoffice 2017/9/12
    Dim xRg As Range
    Dim I As Integer
    Dim xCount As Long
    Dim xRgCol As Long
    Dim xAddress As String
    Dim xFilterCount As Long
    On Error Resume Next
    xAddress = ActiveWindow.RangeSelection.Address
    Set xRg = Application.InputBox("Please select the first cell of the table range:", "KuTools For Excel", xAddress, , , , , 8)
    If xRg Is Nothing Then Exit Sub
    xRg.Select
    With xRg(1).Parent.AutoFilter
        xFilterCount = .Range.Columns.Count
        xRgCol = xRg.Offset(1).Column - .Range.Column + 1
        For I = xRgCol To xFilterCount
            xCount = xRg.Offset(, I - xRgCol).Column - .Range.Column + 1
            With .Filters(xCount)
                If .On Then
                    xRg.Offset(, I - xRgCol).Interior.Color = 16736553
                End If
            End With
        Next
    End With
End Sub

표에서 필터링 된 경우 전체 열을 강조 표시하려면 아래 VBA 코드를 복사하여 모듈 창에 붙여 넣으십시오.

VBA 코드 : 필터링 된 경우 전체 열 강조 표시

Sub HighLightCols()
'Updated by Extendoffice 2017/9/12
    Dim xRg As Range
    Dim xCount As Long
    Dim xRgCol As Long
    Dim xAddress As String
    Dim xRgFilter As Range
    Dim xFilterCount As Long
    On Error Resume Next
    xAddress = ActiveWindow.RangeSelection.Address
    Set xRg = Application.InputBox("Please select the first cell of the table range:", "KuTools For Excel", xAddress, , , , , 8)
    If xRg Is Nothing Then Exit Sub
    xRg.Select
    With xRg(1).Parent.AutoFilter
        xFilterCount = .Range.Columns.Count
        xRgCol = xRg(1).Column - .Range.Column + 1
        For I = xRgCol To xFilterCount
            xCount = xRg.Offset(, I - xRgCol).Column - .Range.Column + 1
            With .Filters(xCount)
                Set xRgFilter = xRg.Offset(, I - xRgCol).Parent.AutoFilter.Range.Columns(xCount)
                If .On Then
                    xRgFilter.Interior.Color = 16736553
                End If
            End With
        Next
    End With
End Sub

3. 누르세요 F5 코드를 실행하는 키입니다. 팝업에서 Excel 용 Kutools 대화 상자에서 필터링 된 열 머리글 또는 전체 필터링 된 열을 강조 표시하는 데 필요한 표의 첫 번째 셀을 선택한 다음 OK 버튼을 클릭합니다.

그런 다음 특정 테이블에서 열이 필터링되면 열 머리글 또는 전체 열이 즉시 강조 표시됩니다. 스크린 샷보기 :

열이 테이블에서 필터링 된 경우 열 머리글을 강조 표시합니다.

표에서 필터링 된 경우 전체 열을 강조 표시합니다.

최고의 사무 생산성 도구

🤖 Kutools AI 보좌관: 다음을 기반으로 데이터 분석을 혁신합니다. 지능형 실행   |  코드 생성  |  사용자 정의 수식 만들기  |  데이터 분석 및 차트 생성  |  Kutools 기능 호출...
인기 기능: 중복 항목 찾기, 강조 표시 또는 식별   |  빈 행 삭제   |  데이터 손실 없이 열이나 셀 결합   |   수식없이 반올림 ...
슈퍼 조회: 다중 기준 VLookup    다중 값 VLookup  |   여러 시트에 걸친 VLookup   |   퍼지 조회 ....
고급 드롭다운 목록: 드롭다운 목록을 빠르게 생성   |  종속 드롭다운 목록   |  다중 선택 드롭 다운 목록 ....
열 관리자: 특정 개수의 열 추가  |  열 이동  |  Toggle 숨겨진 열의 가시성 상태  |  범위 및 열 비교 ...
특색 지어진 특징: 그리드 포커스   |  디자인보기   |   큰 수식 바    통합 문서 및 시트 관리자   |  리소스 라이브러리 (자동 텍스트)   |  날짜 선택기   |  워크 시트 결합   |  셀 암호화/해독    목록으로 이메일 보내기   |  슈퍼 필터   |   특수 필터 (굵게/기울임꼴/취소선 필터링...) ...
상위 15개 도구 세트12 본문 도구 (텍스트 추가, 문자 제거,...)   |   50+ 거래차트 유형 (Gantt 차트,...)   |   40+ 실용 방식 (생일을 기준으로 나이 계산,...)   |   19 삽입 도구 (QR 코드 삽입, 경로에서 그림 삽입,...)   |   12 매출 상승 도구 (숫자를 단어로, 환율,...)   |   7 병합 및 분할 도구 (고급 결합 행, 셀 분할,...)   |   ... 그리고 더

Excel용 Kutools로 Excel 기술을 강화하고 이전과는 전혀 다른 효율성을 경험해 보세요. Excel용 Kutools는 생산성을 높이고 시간을 절약하기 위해 300개 이상의 고급 기능을 제공합니다.  가장 필요한 기능을 얻으려면 여기를 클릭하십시오...

상품 설명


Office Tab은 Office에 탭 인터페이스를 제공하여 작업을 훨씬 쉽게 만듭니다.

  • Word, Excel, PowerPoint에서 탭 편집 및 읽기 사용, Publisher, Access, Visio 및 Project.
  • 새 창이 아닌 동일한 창의 새 탭에서 여러 문서를 열고 만듭니다.
  • 생산성을 50% 높이고 매일 수백 번의 마우스 클릭을 줄입니다!
Comments (5)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
solution that can help create updated vba is TO add additional duplicate first raw in row A1, Row A2 should be the beginning of the filtered data ( exact duplicate of all data in Row A1 - Row A1 and A2 should me same ), so we always have one header line without filter drop down icon and with OG format, once the macro is ran with few columns filtered it will highlight the filtered column as usual and after removing the desired columns filter or all columns filter it should copy the format in A1 Column, for the columns with no filtered sorting can this be done ?
This comment was minimized by the moderator on the site
this would be fantastic for me, but I couldn't make it work. I used the code to color the whole column. when I filtered the first time, the column turned blue. however when I cleared the filter, the blue remained. Afterwards, filtering another column had no effect. so at the moment I am left with one blue column. using latest Excel of Office 365.
This comment was minimized by the moderator on the site
I had the same issue. Once the column is unfiltered. The column remained blue. Also, when do you filter a new column, it's unchanged. The vba doesn't make it highlighted in the new filter column.
This comment was minimized by the moderator on the site
Hi,
Thank you for your comment.
The problem you mentioned is too complicated to acheive now. We will try our best to solve it as soon as possible and let you know after we figure it out.
This comment was minimized by the moderator on the site
To Correct this, change:
If .On Then

xRg.Offset(, I - xRgCol).Interior.Color = 16736553

End If

To:
If .On Then

xRg.Offset(, I - xRgCol).Interior.Color = 16736553

Else

xRg.Offset(, I - xRgCol).Interior.Color = 16777215

End If



Not it will remove the color.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations