메인 컨텐츠로 가기

Excel에서 다른 모든 행 또는 n 번째 행을 선택하는 방법은 무엇입니까?

워크 시트를 사용할 때 때로는 서식 지정, 삭제 또는 복사 목적으로 시트의 다른 모든 행 또는 n 번째 행을 선택해야합니다. 수동으로 선택할 수 있지만 수백 개의 행이있는 경우이 방법은 좋은 선택이 아닙니다. 여기에 도움이되는 몇 가지 요령이 있습니다.

VBA로 다른 모든 행 또는 n 번째 행 선택

Excel 용 Kutools로 다른 모든 행 또는 n 번째 행 선택좋은 생각 3


VBA로 다른 모든 행 또는 n 번째 행 선택

이 예에서는 두 개의 간격이있는 행 하나를 선택합니다. VBA 코드를 사용하면 다음과 같이 완료 할 수 있습니다.

1. 다른 모든 행 또는 n 번째 행을 선택하려는 범위를 강조 표시합니다.

2.Click 개발자 > Visual Basic을새를 애플리케이션 용 Microsoft Visual Basic 창이 표시되면 끼워 넣다 > 모듈을 클릭하고 모듈에 다음 코드를 입력합니다.

Sub EveryOtherRow()
Dim rng As Range
Dim InputRng As Range
Dim OutRng As Range
Dim xInterval As Integer
xTitleId = "KutoolsforExcel"
Set InputRng = Application.Selection
Set InputRng = Application.InputBox("Range :", xTitleId, InputRng.Address, Type:=8)
xInterval = Application.InputBox("Enter row interval", xTitleId, Type:=1)
For i = 1 To InputRng.Rows.Count Step xInterval + 1
    Set rng = InputRng.Cells(i, 1)
    If OutRng Is Nothing Then
        Set OutRng = rng
    Else
        Set OutRng = Application.Union(OutRng, rng)
    End If
Next
OutRng.EntireRow.Select
End Sub

3. 그런 다음 문서 곱하기 계산 3 버튼을 눌러 코드를 실행합니다. 그리고 범위를 선택할 수있는 대화 상자가 나타납니다. 스크린 샷보기 :



4. 클릭 OK,이 경우 다른 팝업 대화 상자에서 간격 행으로 3을 입력합니다. 스크린 샷보기

5. 클릭 OK, 세 번째 행마다 선택되었습니다. 스크린 샷보기 :

초에 필요에 따라 간격을 변경할 수 있습니다. Kutoolsfor엑셀 대화.


Excel 용 Kutools로 다른 모든 행 또는 n 번째 행 선택

VBA 코드를 사용하면 지정된 간격으로 두 개, 세 개 또는 다른 행을 선택해야하는 경우 지정된 간격으로 하나의 행만 선택할 수 있습니다. Excel 용 Kutools 이 문제를 쉽고 편리하게 해결할 수 있습니다.

Excel 용 Kutools, 이상과 300 편리한 기능으로 작업이 더 쉬워집니다. 

무료 설치 Excel 용 Kutools는 다음과 같이하십시오.

1. 클릭 쿠툴 > Select > Select Interval Rows & Columns…, 스크린 샷 참조 :

문서는 다른 모든 행 선택 8

2. 에서  Select Interval Rows & Columns 대화 상자에서문서-대체-범위-이름-7 버튼을 눌러 필요한 범위를 선택하고 Rows or ColumnsSelect 섹션에 있어야 합니다., 원하는 번호를 Interval of 입력 상자 및 Rows 입력 상자. 스크린 샷보기 :

문서는 다른 모든 행 선택 9

문서는 다른 모든 행 선택 10

배송 시 요청 사항:
1. 선택에서 다른 모든 행을 선택해야하는 경우 입력 간격 상자에 2를 입력하고 Rows 입력 상자.

2. 필요한 전체 행을 선택하려면 Select entire rows 옵션을 선택합니다.
문서는 다른 모든 행 선택 11


Excel 용 Kutools로 다른 모든 행 또는 n 번째 행 음영 처리

아래 스크린 샷과 같이 데이터가 더 두드러지게 보이도록 다른 모든 행의 범위를 음영 처리하려면 적용 할 수 있습니다. Excel 용 KutoolsAlternate Row/Column Shading 작업을 신속하게 처리하는 기능.

문서는 다른 모든 행 선택 12
문서 아래쪽 화살표
문서는 다른 모든 행 선택 13

무료 설치 Excel 용 Kutools는 다음과 같이하십시오.

1. 음영 간격을 설정할 셀 범위를 선택하고 쿠툴 > Format > Alternate Row/Column Shading.
문서는 다른 모든 행 선택 14

2. 에서 Alternate Row/Column Shading 대화 상자에서 다음과 같이하십시오.

1) 음영 처리하려는 행 또는 열을 선택하십시오.

2) 선택 Conditional formatting or 표준 서식 당신이 필요로;

3) 음영 간격 지정;

4) 음영 색상을 선택하십시오.
문서는 다른 모든 행 선택 15

3. 클릭 Ok. 이제 범위가 n 번째 행마다 음영 처리되었습니다.

음영을 제거하려면 기존 대체 행 음영 제거 에 옵션 대체 행 / 열 음영 대화.


관련 기사 :

최고의 사무 생산성 도구

🤖 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 (12)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Help, please. This looks great, BUT when I hit the > Run button it fails with a "Compile error: Sub or Function not defined" and the code stopped at "Set rng = InputRng.Rows.Count Step xInterval +1".
This comment was minimized by the moderator on the site
Also I don't get how "Set" and "Step" could ever work together
This comment was minimized by the moderator on the site
Not sure that I will be able to help, but.. First of, there is a spacing between "C" and "ount" in "Count" when i copied your code string over to a module. Secondly, I can´t find your code anywhere else on this page, please submit the whole thing, if the problem remains.
This comment was minimized by the moderator on the site
Replace OutRng.EntireRow.Select with Intersect(OutRng.EntireRow, InputRng).Select if you want every other row within your selection
This comment was minimized by the moderator on the site
really good, thanks!
This comment was minimized by the moderator on the site
The code has one request. Does it have to select the ENTIRE ROW for each nth row? Can't it just select certain cells (range of cells) within each nth row? I don't need all the information in each row. Just certain cells of each nth row.
This comment was minimized by the moderator on the site
I made the modifications below to select 30 rows Sub EveryOtherRow() Dim rng As Range Dim InputRng As Range Dim OutRng As Range Dim xInterval As Integer xTitleId = "KutoolsforExcel" Set InputRng = Application.Selection Set InputRng = Application.InputBox("Range :", xTitleId, InputRng.Address, Type:=8) xInterval = Application.InputBox("Enter row interval", xTitleId, Type:=1) For i = 1 To InputRng.Rows.Count Step xInterval + 1 Set rng = InputRng.Cells(i, 1).Resize(, 30) 'Resize to the number of columns to select, 30 in this case If OutRng Is Nothing Then Set OutRng = rng Else Set OutRng = Application.Union(OutRng, rng) End If Next OutRng.Select 'Use OutRng.EntireRow.Select to select the entire row End Sub
This comment was minimized by the moderator on the site
Nice, thanks, this was very helpful ^_^
This comment was minimized by the moderator on the site
fanatastic. thanks a lot.it works perfect.I have more than 7000 data that need to select them with different interval.this trick was like a miracle for me.thaaaaaaaanks.
This comment was minimized by the moderator on the site
I'm trying to use the VBA macro in Excel 2010. It will only select the first nth row, not all of them in the selection. If I run it again, it will go to the next. Any idea what I'm doing wrong? Thanks!
This comment was minimized by the moderator on the site
Just saved my ass with this code thanks! My matlab decided to randomly stop working and so I had to resort to excel which I am not as familiar with as with Matlab. This def. helped. Thanks.
This comment was minimized by the moderator on the site
I need to select multiple rows and a fixed interval and move to the other sheet please answer me as soon as possible 
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations