메인 컨텐츠로 가기

Excel에서 확인란으로 셀 또는 행을 강조 표시하는 방법은 무엇입니까?

아래 스크린 샷과 같이 체크 박스로 행 또는 셀을 강조 표시해야합니다. 체크 박스를 선택하면 지정된 행이나 셀이 자동으로 강조 표시됩니다. 그러나 Excel에서 어떻게 달성합니까? 이 기사에서는이를 달성하는 두 가지 방법을 보여줍니다.

조건부 서식이있는 확인란으로 셀 또는 행 강조 표시
VBA 코드로 확인란을 사용하여 셀 또는 행 강조 표시


조건부 서식이있는 확인란으로 셀 또는 행 강조 표시

Excel에서 확인란을 사용하여 셀 또는 행을 강조 표시하는 조건부 서식 규칙을 만들 수 있습니다. 다음과 같이하십시오.

모든 확인란을 지정된 셀에 연결

1. 클릭하여 수동으로 셀에 체크 박스를 하나씩 삽입해야합니다. 개발자 > 끼워 넣다 > 확인란 (양식 컨트롤).

2. 이제 확인란이 I 열의 셀에 삽입되었습니다. I1에서 첫 번째 확인란을 선택하고 수식을 입력하십시오. = $ J1 수식 표시 줄에 입력 한 다음 엔터 버튼 키.

: 인접한 셀의 값을 확인란에 연결하지 않으려면 확인란을 다음과 같은 다른 워크 시트의 셀에 연결할 수 있습니다. = Sheet3! $ E1.

2. 모든 확인란이 다른 워크 시트의 인접한 셀이나 셀에 연결될 때까지 1 단계를 반복합니다.
주의 사항: 연결된 모든 셀은 연속적이고 동일한 열에 있어야합니다.

조건부 서식 규칙 만들기

이제 다음과 같이 단계별로 조건부 서식 규칙을 만들어야합니다.

1. 확인란으로 강조 표시해야하는 행을 선택한 다음 조건부 서식 > 새로운 규칙 아래 탭. 스크린 샷보기 :

2. 에서 새로운 서식 규칙 대화 상자에서 다음을 수행해야합니다.

2.1 선택 수식을 사용하여 서식을 지정할 셀 결정 에서 옵션 규칙 유형 선택 상자;

2.2 수식 입력 = IF ($ J1 = TRUE, TRUE, FALSE) 이 공식이 참인 경우 값 형식 지정 상자;
      Or = IF (Sheet3! $ E1 = TRUE, TRUE, FALSE) 확인란이 다른 워크 시트에 연결된 경우

2.3 형성 행의 강조 색상을 지정하는 버튼;

2.4 OK 단추. 스크린 샷보기 :

주의 사항: 공식에서 $ J1 or $ E1 확인란에 대해 첫 번째로 연결된 셀이고 셀 참조가 절대 열 ()로 변경되었는지 확인합니다.J1> $ J1 or E1> $ E1).

이제 조건부 서식 규칙이 생성됩니다. 확인란을 선택하면 해당 행이 다음 스크린 샷과 같이 자동으로 강조 표시됩니다.


VBA 코드로 확인란을 사용하여 셀 또는 행 강조 표시

다음 VBA 코드는 Excel에서 확인란을 사용하여 셀 또는 행을 강조 표시하는데도 도움이 될 수 있습니다. 다음과 같이하십시오.

1. 워크 시트에서 체크 박스가있는 셀 또는 행을 강조 표시해야합니다. 오른쪽 클릭 시트 탭 선택 코드보기 오른쪽 클릭 메뉴에서 응용 프로그램 용 Microsoft Visual Basic 창.

2. 그런 다음 아래 VBA 코드를 복사하여 코드 창에 붙여 넣습니다.

VBA 코드 : Excel에서 확인란이있는 행 강조 표시

Sub AddCheckBox()
Dim xCell As Range
Dim xRng As Range
Dim I As Integer
Dim xChk As CheckBox
On Error Resume Next
InputC:
    Set xRng = Application.InputBox("Please select the column range to insert checkboxes:", "Kutools for Excel", Selection.Address, , , , , 8)
If xRng Is Nothing Then Exit Sub
If xRng.Columns.Count > 1 Then
    MsgBox "The selected range should be a single column", vbInformation, "Kutools fro Excel"
    GoTo InputC
Else
    If xRng.Columns.Count = 1 Then
        For Each xCell In xRng        
            With ActiveSheet.CheckBoxes.Add(xCell.Left, _
               xCell.Top, xCell.Width = 15, xCell.Height = 12)
               .LinkedCell = xCell.Offset(, 1).Address(External:=False)
               .Interior.ColorIndex = xlNone
               .Caption = ""
               .Name = "Check Box " & xCell.Row
            End With    
            xRng.Rows(xCell.Row).Interior.ColorIndex = xlNone                  
        Next        
    End If    
    With xRng    
     .Rows.RowHeight = 16    
    End With   
    xRng.ColumnWidth = 5#    
    xRng.Cells(1, 1).Offset(0, 1).Select    
    For Each xChk In ActiveSheet.CheckBoxes   
      xChk.OnAction = ActiveSheet.Name + ".InsertBgColor"      
    Next
End If
End Sub

Sub InsertBgColor()
Dim xName As Integer
Dim xChk As CheckBox
For Each xChk In ActiveSheet.CheckBoxes 
  xName = Right(xChk.Name, Len(xChk.Name) - 10) 
  If (xName = Range(xChk.LinkedCell).Row) Then   
   If (Range(xChk.LinkedCell) = "True") Then   
    Range("A" & xName, Range(xChk.LinkedCell).Offset(0, -2)).Interior.ColorIndex = 6    
   Else    
    Range("A" & xName, Range(xChk.LinkedCell).Offset(0, -2)).Interior.ColorIndex = xlNone  
   End If  
  End If
Next
End Sub

3. 누르세요 F5 코드를 실행하는 키입니다. (주의 사항: F5 키를 적용하려면 코드의 첫 부분에 커서를 놓아야합니다.) 팝업에서 Excel 용 Kutools 대화 상자에서 삽입 할 범위 확인란을 선택한 다음 OK 단추. 여기서는 I1 : I6 범위를 선택합니다. 스크린 샷보기 :

4. 그런 다음 선택한 셀에 확인란이 삽입됩니다. 확인란 중 하나를 선택하면 아래 스크린 샷과 같이 해당 행이 자동으로 강조 표시됩니다.


관련 기사:

최고의 사무 생산성 도구

🤖 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 (3)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
This is a horrendous article. It lacks a lot of information and steps. If you follow this article verbatim it will not end in the result you are seeking.

Essentially the article is saying to have 2 columns where the checkboxes are linked to adjacent columns to enter in values which are then used for conditional formats. No one wants to have values associated in adjacent cells to checkboxes. Lastly, if this is the route you're going you're not linking checkboxes to conditional formats, you are linking checkboxes to cell values which are then in turn associated to conditional formats.

It is easier to just use icons instead of checkboxes (use the green checkmark icon) and create the conditional formats for a value of 1 or 0. If cell = 1 then it will replace the value with the icon and highlight your row. To accomplish this you use 2 conditional formats on your table.

Top left of table is B4, bottom right of table is L28

1st conditional format:
USE A FORMULA TO DETERMINE WHICH CELLS TO FORMAT
Formula: =$B4=1
Format: fill
Applies to: =$B4:$L28

2nd conditional format:
FORMAT CELLS BASED ON THEIR VALUES
Icon Set Custom
SHOW ICON ONLY (check this box off)
First icon (green checkmark) when value is > = 1 (type: number)
Second icon (no icon) when value is > = -1 (type: number)
Third icon (no icon) when < -1

Now, when I enter a 1 in B4 or any of the B column cells, it will highlight the entire row for me and replace the "1" with a checkmark.

BUILT-IN TEMPLATE WITH THIS FORMATTING:
1) Open Excel, search for a new template. Enter "Inventory" as the search term
2) Select the template titled "Inventory list with highlighting"
3) Highlight the first row of the table, open conditional formats to manage/edit. You will see the 2nd and 3rd formats are for highlights and the icon in the B column. You can change the icon to whatever you want. Remove the first format if you don't want the strikeout options from the Discontinued column.
This comment was minimized by the moderator on the site
I have a question about the initial step of linking the checkbox to a true/false.

1. Select the first check box in I1, enter formula =$J$1 into the formula bar, and then press the Enter key.

2. Repeat step 1 until all check boxes are linked to the adjacent cells.

For the repeat, does it have to be done for each cell or can you get the drag down to autofill? Right now, when I drag down the corner box it will autofill with =$J$1 for everything so that if I check one box, every box is checked. How can I fix this without manually linking each checkbox?
This comment was minimized by the moderator on the site
Hi,
The Fill Handle can't help in this case. You need to manually link each checkbox to its adjacent cell.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations