메인 컨텐츠로 가기

Excel에서 병합 된 셀의 번호를 자동으로 지정하는 방법은 무엇입니까?

Excel에서 여러 크기의 병합 된 셀 목록에 시리즈 번호를 어떻게 채울 수 있습니까? 먼저 자동 채우기 핸들을 드래그하여 병합 된 셀을 채우는 것이지만이 경우 다음 경고 메시지가 표시되고 병합 된 셀을 채울 수 없습니다.

문서 채우기 병합 셀-1

채우기 핸들은 병합 된 셀을 지원하지 않으므로 여기에서이 문제를 해결하기위한 몇 가지 다른 트릭에 대해 이야기 할 수 있습니다.

자동 번호 매기기 / 병합 된 셀을 VBA 코드로 채우기


화살표 블루 오른쪽 거품 자동 번호 매기기 / 병합 된 셀을 VBA 코드로 채우기

다음 VBA 코드를 사용하면 선택한 병합 된 셀의 번호를 빠르게 지정할 수 있습니다. 다음과 같이하십시오 :

1. 누르고 ALT + F11 키가 열립니다. Microsoft Visual Basic for Applications 창.

2. 딸깍 하는 소리 끼워 넣다 > 모듈을 클릭하고 다음 코드를 모듈 창.

VBA 코드 : 병합 된 셀 자동 번호

Sub NumberCellsAndMergedCells()
	'Update 20141028
	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)
	Set WorkRng = WorkRng.Columns(1)
	xIndex = 1
	Set Rng = WorkRng.Range("A1")
	Do While Not Intersect(Rng, WorkRng) Is Nothing
		Rng.Value = xIndex
		xIndex = xIndex + 1
		Set Rng = Rng.MergeArea.Offset(1)
	Loop
End Sub

3. 그런 다음 F5 키를 눌러이 코드를 실행하면 채우려는 병합 된 셀을 선택할 수있는 프롬프트 상자가 나타납니다. 스크린 샷을 참조하십시오.

문서 채우기 병합 셀-1

4. 병합 된 셀을 선택한 후 OK, 이제 선택한 병합 셀이 일련 번호로 채워졌습니다. 스크린 샷을 참조하십시오.

문서 채우기 병합 셀-1


관련 기사 :

Excel에서 필터 후 번호를 자동으로 지정하거나 번호를 다시 매기는 방법은 무엇입니까?

Excel에서 인접한 행을 동일한 데이터로 빠르게 병합하는 방법은 무엇입니까?

셀 병합을 해제하고 Excel에서 중복 값으로 채우는 방법은 무엇입니까?

최고의 사무 생산성 도구

🤖 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 (10)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Thank you!! :)
This comment was minimized by the moderator on the site
Cuando se generan celdas combinadas de diferentes tamaños, y que queremos numerar, podemos seleccionarlas y vaciar el contenido... en seguida con la siguiente fórmula : =IF(Q7="",(COUNTIF($Q$7:Q7,"")),SUBSTITUTE("TRUE","TRUE","")) esta detectará que no hay nada y en la casilla combinada pondrá un consecutivo iniciando con el 1- No importa el tamaño de la celda combinada, solo pondrá el numero al principio de la celda combinada.
This comment was minimized by the moderator on the site
Hi,

How to convert a cell with

Apple, Lemon, Water, Soda, Cap, Bat

into

1. Apple, 2. Lemon, 3. Water, 4. Cap, 5. Bat
This comment was minimized by the moderator on the site
Is there a way to exclude a merged cell that has text in it? This script works perfectly but I'm traversing a document that includes several horizontally merged cells that are made into title bars and I want to skip over/exclude those. Any help would be greatly appreciated!
This comment was minimized by the moderator on the site
This code is working perfectly.


Sub NumberCellsAndMergedCells()
'Update 20141028
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)
Set WorkRng = WorkRng.Columns(1)
xIndex = 1
Set Rng = WorkRng.Range("A1")
Do While Not Intersect(Rng, WorkRng) Is Nothing
Rng.Value = xIndex
xIndex = xIndex + 1
Set Rng = Rng.MergeArea.Offset(1)
Loop
End Sub


BUT i want it to select range automatically instead of Set WorkRng = Application.Selection.
Please help.
This comment was minimized by the moderator on the site
I purchased the Kutools so it would help me auto increment my invoice numbering but I am not seeing that feature in the add-in on the Excel tool bar. Maybe I'm not looking for the correct name but I am not finding how to insert this into my invoice template. Any out there
This comment was minimized by the moderator on the site
Hi, was wondering if there is anyway to alter the code where the range value will increase by one e.g. I am trying to use this for invoices and the number should go from NR000026489 to NR000026490, but using the code above with the modification given to JYOTHI it would increase from NR000026489 to NR0000264810. Any help would be greatly appreciated as I've spent ages trying different things but am not advanced enough in VB. Thanks very much :)
This comment was minimized by the moderator on the site
Modify: Do While Not Intersect(Rng, WorkRng) Is Nothing a = xIndex Rng.Value = "Tc_" & a xIndex = xIndex + 1 Set Rng = Rng.MergeArea.Offset(1) Loop
This comment was minimized by the moderator on the site
It is very helpful. but I need one solution, suppose I want to fill series into merged cells but the content of merged cell have data like TC_01, Is it possible to fill next merged cells like TC_02, TC_03etc.. If its possible it helps me a lot. Thanks in advance.
This comment was minimized by the moderator on the site
This was really helpful and solved my problem immediately, thank you very much!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations