메인 컨텐츠로 가기

Excel에서 셀에 XNUMX이 포함되어 있으면 전체 행을 삭제하는 방법은 무엇입니까?

때로는 Excel에서 셀에 XNUMX이 포함되어 있으면 전체 행을 삭제하고 몇 개가 있으면 하나씩 삭제할 수 있습니다. 그러나 XNUMX을 포함하는 수백 개의 행을 제거해야하는 것은 어떻습니까? 아래에서 까다로운 방법 중 하나를 선택하여 해결할 수 있습니다.

Excel의 필터 기능을 사용하여 셀에 XNUMX이 포함 된 경우 행 삭제
Excel에서 VBA를 사용하여 셀에 XNUMX이 포함되어 있으면 행 삭제
Excel 용 Kutools로 셀에 XNUMX이 포함되어 있으면 행 삭제


Excel의 필터 기능을 사용하여 셀에 XNUMX이 포함 된 경우 행 삭제

필터 기능을 사용하여 특정 열의 XNUMX 값을 기준으로 모든 행을 필터링 한 다음 나중에 보이는 모든 행을 삭제할 수 있습니다. 다음과 같이하십시오.

1. 전체 행을 삭제하려는 XNUMX 값이 포함 된 열 셀을 선택한 다음 Data > 필터. 스크린 샷보기 :

2. 그런 다음 선택한 열의 첫 번째 셀에 드롭 다운 화살표가 표시됩니다. 화살표를 클릭 한 다음 번호 필터 > 같음 드롭 다운 목록에서

1 인 경우 문서 삭제 XNUMX

3. 에서 사용자 정의 자동 필터 대화 상자, 숫자 입력 0 아래 스크린 샷과 같이 텍스트 상자에 입력 한 다음 OK 버튼을 클릭합니다.

1 인 경우 문서 삭제 XNUMX

4. 그런 다음이 특정 열의 모든 XNUMX 값 셀이 필터링됩니다. 필터 범위에서 보이는 모든 셀을 선택하고 마우스 오른쪽 버튼으로 클릭하고 행 삭제 오른쪽 클릭 메뉴에서. 팝업 프롬프트 상자에서 OK 단추. 스크린 샷보기 :

1 인 경우 문서 삭제 XNUMX

5. 이제 보이는 모든 행이 삭제됩니다. 클릭 할 수 있습니다. Data > 필터 값이 XNUMX 인 셀이없는 모든 데이터를 다시 표시합니다. 스크린 샷보기 :

1 인 경우 문서 삭제 XNUMX


Excel의 특정 범위에 XNUMX 값이 있으면 모든 행을 쉽게 삭제할 수 있습니다.

Excel 용 Kutools 특정 셀 선택 유틸리티를 사용하면 특정 범위에 XNUMX 값이있는 경우 전체 행을 쉽게 선택할 수 있으며 실수없이 선택한 모든 행을 수동으로 빠르게 삭제할 수 있습니다.
지금 다운로드하여 사용해 보세요! (30일 무료 트레일)


Excel에서 VBA를 사용하여 셀에 XNUMX이 포함되어 있으면 행 삭제

이 섹션에서는 Excel의 특정 열에 XNUMX 값이있는 경우 모든 행을 삭제하는 VBA 방법을 보여줍니다.

1. 프레스 Alt + F11 표시하는 동시에 키 응용 프로그램 용 Microsoft Visual Basic 창.

2. Microsoft Visual Basic for Applications 창에서 끼워 넣다 > 모듈, 그런 다음 다음 VBA 코드를 복사하여 모듈 창에 붙여 넣습니다.

VBA : 워크 시트의 특정 열 범위에 XNUMX 값이있는 경우 전체 행 삭제

Sub DeleteZeroRow () 'Updateby20140616 Dim Rng As Range Dim WorkRng As Range On Error Resume Next xTitleId = "KutoolsforExcel"Set WorkRng = Application.Selection Set WorkRng = Application.InputBox ( "Range", xTitleId, WorkRng.Address, Type : = 8 ) Application.ScreenUpdating = False Do Set Rng = WorkRng.Find ( "0", LookIn : = xlValues) Rng가 아닌 경우 Rng.EntireRow.Delete End If Loop while Not Rng Is Nothing Application.ScreenUpdating = True End Sub

3. 누르세요 F5 팝업에서 코드를 실행하는 키 Kutoolsfor엑셀 대화 상자에서 내부의 XNUMX 값을 기준으로 전체 행을 삭제할 열 범위를 선택한 다음 OK 단추. 스크린 샷보기 :

1 인 경우 문서 삭제 XNUMX

그런 다음 지정된 열 범위의 XNUMX 값을 기반으로하는 모든 행이 즉시 삭제됩니다.

1 인 경우 문서 삭제 XNUMX


Excel 용 Kutools로 셀에 XNUMX이 포함되어 있으면 행 삭제

많은 Excel 사용자의 경우 VBA 코드를 사용하면 Excel에서 데이터를 제거하는 것이 위험합니다. VBA 코드를 정확히 신뢰하지 않는 경우 여기에서 시도해 보는 것이 좋습니다. 특정 셀 선택 ~의 유용성 Excel 용 Kutools.

신청하기 전에 Excel 용 Kutools, 제발 먼저 다운로드하여 설치하십시오..

1. 내부의 XNUMX 값을 기준으로 전체 행을 제거 할 열 범위를 선택한 다음 쿠툴 > 선택 > 특정 셀 선택. 스크린 샷보기 :

2. 에서 특정 셀 선택 대화 상자에서 다음을 수행해야합니다.

(1) 선택 전체 행 에서 옵션 선택 유형 안내

(2) 선택 같음 처음에는 특정 유형 드롭 다운 목록을 클릭 한 다음 숫자 입력 0 텍스트 상자에.

(3) OK 버튼을 클릭합니다.

3. 선택한 행 수를 알려주는 대화 상자가 나타나면 OK 단추. 이제 지정된 열 범위에 XNUMX 값이있는 모든 행이 선택됩니다. 선택한 행을 마우스 오른쪽 버튼으로 클릭 한 다음 . 오른쪽 클릭 메뉴에서. 스크린 샷보기 :

1 인 경우 문서 삭제 XNUMX

이제 지정된 열에 XNUMX 값이있는 모든 행이 즉시 삭제됩니다. 스크린 샷보기 :

1 인 경우 문서 삭제 XNUMX

  이 유틸리티의 무료 평가판 (30 일)을 받으려면 그것을 다운로드하려면 클릭하십시오을 클릭 한 다음 위 단계에 따라 작업 적용으로 이동합니다.


Excel 용 Kutools로 셀에 XNUMX이 포함되어 있으면 행 삭제


관련 기사 :

최고의 사무 생산성 도구

🤖 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 (15)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Despues de utilizar subtotal Como hacer para eliminar las filas involucradas que en el subtotal es igual a 0?
This comment was minimized by the moderator on the site
Insert this in VB new module.
This is with InputBox to delete row which contains that word.

Attribute VB_Name = "FindDelRowByWord"
Sub FindDelRow()
'Updateby20140616
Dim Rng As Range
Dim WorkRng As Range
Dim xRep As String
On Error Resume Next
xTitleId = "ZOK Tools"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
xRep = Application.InputBox("word to delete Row:", "ZOK Tools", , , , , 2)
Application.ScreenUpdating = False
Do
Set Rng = WorkRng.Find(xRep, LookIn:=xlValues)
If Not Rng Is Nothing Then
Rng.EntireRow.Delete
End If
Loop While Not Rng Is Nothing
Application.ScreenUpdating = True
End Sub
This comment was minimized by the moderator on the site
WHAT IF you have a big sheet, and there are rows you want to keep, and others rows that contain certain key words and delete those? the kutools work for me but for one key word that many rows have that key word, the rows were deleted, i just want to have multiple key words to do the same? does this work for the code above?
This comment was minimized by the moderator on the site
Good Day,
Kutools can deal with two key words at the same time. You need to enable its second condition with "And" or "Or". Hope I can help.
This comment was minimized by the moderator on the site
This didn't work for me. It changed all values in my chosen column and the adjacent column to zeros. I must be doing something wrong!
This comment was minimized by the moderator on the site
Hi Sheri,
The code works well in my case. Which Excel verson do you use?
This comment was minimized by the moderator on the site
Hi Crystal. I posted this two years ago so I’m guessing I figured it out. But thanks for the reply.
This comment was minimized by the moderator on the site
Hi dears , I need a code to hide the rows which have the value=0 on the column "N" in the sheet 1. The value of the column "N" will change when update the details on the Sheet 2. that's the time need to un-hide the row. is this possible to do this with Excel formula(without macro and Excel Filters).
This comment was minimized by the moderator on the site
modified for my purpose--thank you for your help: Sub DeleteZeroRow() Dim Rng As Range Dim WorkRng As Range On Error Resume Next xTitleId = "" Application.Calculation = xlManual MsgBox "Set the range you want to remove the unused 0 quantity rows from" Set WorkRng = Application.InputBox("Range", xTitleId, "FG93:FG500", Type:=8) Application.ScreenUpdating = False Sheets("ENTRY").Select Do Set Rng = WorkRng.Find("0", LookIn:=xlValues) If Not Rng Is Nothing Then Rng.EntireRow.Delete End If Loop While Not Rng Is Nothing Application.ScreenUpdating = True Range("FF92").Select Selection.End(xlDown).Select MsgBox "Removed 0's ROWS from column FG--calculating now--please wait" Application.Calculation = xlAutomatic End Sub
This comment was minimized by the moderator on the site
I modified the below code to work for me. This deleted every row in column C that had "Delete" in the cell of column C. Sub Delete_DeleteRows() Set WorkRng = Range("C2:C12000") Application.ScreenUpdating = False Do Set Rng = WorkRng.Find("Delete", LookIn:=xlValues) If Not Rng Is Nothing Then Rng.EntireRow.Delete End If Loop While Not Rng Is Nothing Application.ScreenUpdating = True End Sub
This comment was minimized by the moderator on the site
Hi,
its worked for me, thanks a lot.
if I have multiple sheets? how i can run the script 1 time for all the sheets?
This comment was minimized by the moderator on the site
thanks for the response, worked for me
This comment was minimized by the moderator on the site
I modified the above code to work for me. I wanted to delete every row that had "Delete" in row C. Sub Delete_DeleteRows() Set WorkRng = Range("C2:C12000") Application.ScreenUpdating = False Do Set Rng = WorkRng.Find("Delete", LookIn:=xlValues) If Not Rng Is Nothing Then Rng.EntireRow.Delete End If Loop While Not Rng Is Nothing Application.ScreenUpdating = True End Sub
This comment was minimized by the moderator on the site
Your VB code doesn't work. It deletes all rows with a Zero in the 10s position. I hope no one actually uses this as they will delete data...
This comment was minimized by the moderator on the site
This was a life saver!!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations