메인 컨텐츠로 가기

Excel의 각 행에 대해 새 시트를 만드는 방법은 무엇입니까?

A 열에 모든 학생의 이름이 있는 점수 테이블이 있다고 가정합니다. 이제 A 열에 이러한 이름을 기반으로 새 시트를 만들고 시트당 만들기에 고유한 학생 데이터가 포함되어 있다고 가정합니다. 또는 A열의 이름을 고려하지 않고 테이블의 각 행에 대해서만 새 시트를 생성하십시오. 이 비디오에서는 이를 달성하는 방법을 얻을 수 있습니다.

VBA 코드로 각 행에 대한 새 시트 만들기
Excel 용 Kutools의 데이터 분할 유틸리티를 사용하여 각 행에 대한 새 시트 만들기


VBA 코드로 각 행에 대한 새 시트 만들기

다음 코드를 사용하면 열 값을 기반으로 새 시트를 만들거나 Excel의 각 행에 대해 새 시트를 만들 수 있습니다.

1. 프레스 다른 + F11 동시에 열려면 키 응용 프로그램 용 Microsoft Visual Basic 창.

2. 에서 응용 프로그램 용 Microsoft Visual Basic 창을 클릭합니다 끼워 넣다 > 모듈. 그런 다음 다음 코드를 모듈 창.

VBA 코드 : 열을 기반으로 각 행에 대한 새 시트 만들기

Sub parse_data()
'Update by Extendoffice 2018/3/2
    Dim xRCount As Long
    Dim xSht As Worksheet
    Dim xNSht As Worksheet
    Dim I As Long
    Dim xTRrow As Integer
    Dim xCol As New Collection
    Dim xTitle As String
    Dim xSUpdate As Boolean
    Set xSht = ActiveSheet
    On Error Resume Next
    xRCount = xSht.Cells(xSht.Rows.Count, 1).End(xlUp).Row
    xTitle = "A1:C1"
    xTRrow = xSht.Range(xTitle).Cells(1).Row
    For I = 2 To xRCount
        Call xCol.Add(xSht.Cells(I, 1).Text, xSht.Cells(I, 1).Text)
    Next
    xSUpdate = Application.ScreenUpdating
    Application.ScreenUpdating = False
    For I = 1 To xCol.Count
        Call xSht.Range(xTitle).AutoFilter(1, CStr(xCol.Item(I)))
        Set xNSht = Nothing
        Set xNSht = Worksheets(CStr(xCol.Item(I)))
        If xNSht Is Nothing Then
            Set xNSht = Worksheets.Add(, Sheets(Sheets.Count))
            xNSht.Name = CStr(xCol.Item(I))
        Else
            xNSht.Move , Sheets(Sheets.Count)
        End If
        xSht.Range("A" & xTRrow & ":A" & xRCount).EntireRow.Copy xNSht.Range("A1")
        xNSht.Columns.AutoFit
    Next
    xSht.AutoFilterMode = False
    xSht.Activate
    Application.ScreenUpdating = xSUpdate
End Sub

주의 사항: A1 : C1은 테이블의 제목 범위입니다. 필요에 따라 변경할 수 있습니다.

3. 프레스 F5 키를 눌러 코드를 실행하면 아래 스크린 샷과 같이 현재 통합 문서의 모든 워크 시트 다음에 새 워크 시트가 생성됩니다.

열 값을 고려하지 않고 각 행에 대해 직접 새 시트를 작성하려는 경우 다음 코드를 사용할 수 있습니다.

VBA 코드 : 각 행에 대해 직접 새 시트 만들기

Sub RowToSheet()
	Dim xRow As Long
	Dim I As Long
	With ActiveSheet
		xRow = .Range("A" & Rows.Count).End(xlUp).Row
		For I = 1 To xRow
			Worksheets.Add(, Sheets(Sheets.Count)).Name = "Row " & I
			.Rows(I).Copy Sheets("Row " & I).Range("A1")
		Next I
	End With
End Sub

코드를 실행하면 활성 워크 시트의 각 행이 새 워크 시트에 배치됩니다.

주의 사항: 머리글 행도이 VBA 코드를 사용하여 새 시트에 배치됩니다.


Excel 용 Kutools의 데이터 분할 유틸리티를 사용하여 각 행에 대한 새 시트 만들기

사실 위의 방법은 복잡하고 이해하기 어렵습니다. 이 섹션에서는 데이터 분할 ~의 유용성 Excel 용 Kutools.

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

1. 새 시트를 만드는 데 사용해야하는 테이블을 선택한 다음 쿠툴즈 플러스> 침 데이터. 스크린 샷보기 :

2. 에서 데이터를 여러 워크 시트로 분할 대화 상자에서 다음과 같이하십시오.

A. 열 값을 기준으로 새 시트를 만드는 경우 :

1). 선택하십시오 특정 열 옵션을 클릭하고 드롭 다운 목록에서 데이터를 분할 할 열을 지정합니다.
2). 열 값으로 워크 시트의 이름을 지정하려면 다음을 선택하십시오. 컬럼 값 FBI 증오 범죄 보고서 규칙 드롭 다운 목록;
3). 클릭 OK 단추. 스크린 샷보기 :

B. 각 행에 대한 새 시트를 직접 만드는 경우 :

1). 고르다 고정 행 옵션, 숫자 입력 1 상자에;
2). 고르다 행 번호 인사말 규칙 드롭 다운 목록;
3). 클릭 OK 단추. 스크린 샷보기 :

내부에 모든 새 시트가 포함 된 새 통합 문서가 생성됩니다. 아래 스크린 샷을 참조하십시오.

열 값을 기반으로 각 행에 대한 새 시트 만들기 :

열 값을 고려하지 않고 각 행에 대해 새 시트 만들기 :

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

Excel 용 Kutools의 데이터 분할 유틸리티를 사용하여 각 행에 대한 새 시트 만들기

최고의 사무 생산성 도구

🤖 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 (33)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
HI, Thanks for this wonder-full code, Can we get dynamic sheet, means if i update data in respective sheet it will get updated in main sheet.
This comment was minimized by the moderator on the site
Hi vikas chandra,
I can't fix this problem. Sorry about that.
This comment was minimized by the moderator on the site
Hi, I have a problem about title, the title range of my table is A1:AI2, when I changed the code like that it doesn't work.

***Note: A1:C1 is the title range of your table. You can change it based on your needs.***
This comment was minimized by the moderator on the site
Hello, thanks so much for this. I'm looking to modify the macro such that it will create a sheet for each row of a column and within each sheet have a function (average) that I can populate data into and in turn have the outcome linked back into the original sheet. Is this possible? I can try to clarify further if this doesn't make sense or is ambiguous.
This comment was minimized by the moderator on the site
Hi, is there a code which would add only 1 new sheet each time the macro is run, eg 1st time the new sheet would be named on the contents of cell A1, 2nd time the macro was run the new sheet would be named on the contents of A2 etc. thanks in anticipation
This comment was minimized by the moderator on the site
Hello, used this code and worked, but If I want select the more then one rows in header, what will be change in the code ? I have multiple lines in the sheet which I want in every sheet.
This comment was minimized by the moderator on the site
Hello, did you figured out how?
This comment was minimized by the moderator on the site
Hello! I just used this code and it worked! In addition to creating a new sheet for each entry, I want to transpose it to columns and can't figure it out. So for the above example, the output for Nana would look like this - Name NanaScore 86No. 2
This comment was minimized by the moderator on the site
<p> Nana
86
2</p>
This comment was minimized by the moderator on the site
How to reference the use of the code above (credit) ? Is it possible to modify the code ?
This comment was minimized by the moderator on the site
Hi, this is an open communication platform. The code is allowed to reference and modify.
This comment was minimized by the moderator on the site
Nevermind it was hidden trailing spaces. I used the TRIM feature and cleaned it up. Having a row count (line count really so rows -1 prepended to the sheet would be amazing)
This comment was minimized by the moderator on the site
Please can i get help on how to automatically name the sheets using a particular column. This is for the row to sheet VBA. See below

Sub RowToSheet()

Dim xRow As Long

Dim I As Long

With ActiveSheet

xRow = .Range("A" & Rows.Count).End(xlUp).Row

For I = 1 To xRow

Worksheets.Add(, Sheets(Sheets.Count)).Name = "Row " & I

.Rows(I).Copy Sheets("Row " & I).Range("A1")

Next I

End With

End Sub
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations