메인 컨텐츠로 가기

Excel 데이터 (선택 또는 시트)를 Excel의 텍스트 파일로 내보내는 방법은 무엇입니까?

통합 문서를 텍스트 파일 형식으로 전달해야하는 경우 통합 문서를 텍스트 파일로 변환해야합니다. 이 기사에서는 Excel 데이터를 텍스트 파일로 쉽게 내보내는 두 가지 방법을 소개합니다.

단일 시트를 Excel의 텍스트 파일로 내보내기

기본적으로 Excel 데이터는 다음 형식의 통합 문서로 저장됩니다. . XLSX. 그러나 기존 통합 문서의 워크 시트를 텍스트 파일로 내보낼 수 있습니다. 다른 이름으로 저장 특색. 다음과 같이하십시오 :

1. 텍스트 파일로 내보낼 워크 시트로 이동하고 입양 부모로서의 귀하의 적합성을 결정하기 위해 미국 이민국에 (또는 사무실 버튼)> 다른 이름으로 저장.

2. 오프닝에서 다른 이름으로 저장 대화 상자에서 내 보낸 텍스트 파일을 저장할 대상 폴더를 선택하고 파일 이름 상자를 선택한 다음 유니 코드 텍스트 (* .txt) 형식으로 저장 드롭 다운 목록. 스크린 샷보기 :
다른 이름으로 저장 기능을 사용하여 텍스트 파일로 내보내기

3. 그런 다음 활성 워크 시트 만 텍스트 파일로 내보내고 텍스트 파일과 호환되지 않는 기능은 제외하도록 요청하는 두 개의 경고 대화 상자가 나타납니다. 딸깍 하는 소리 OK 버튼 가능 버튼을 연속적으로 누릅니다.

그런 다음 활성 워크 시트의 데이터가 새 텍스트 파일로 내보내집니다.

주의 사항다음 다른 이름으로 저장 명령은 활성 워크 시트의 데이터를 텍스트 파일로만 내보낼 수 있습니다. 전체 통합 문서의 모든 데이터를 내보내려면 각 워크 시트를 개별적으로 텍스트 파일로 저장해야합니다.


VBA를 사용하여 선택 (또는 하나의 열)을 텍스트 파일로 내보내기

다음 VBA 코드는 선택한 범위 데이터 (예 : 한 열)를 텍스트 파일로 내보내는데도 도움이 될 수 있습니다. 다음과 같이하십시오.

1. 누르고있어. ALT + F11 키가 열립니다. 응용 프로그램 용 Microsoft Visual Basic 창.

2. 끼워 넣다 > 모듈을 클릭하고 모듈 창에 다음 코드를 붙여 넣습니다.

VBA : 선택 항목 또는 전체 워크 시트를 텍스트 파일로 내보내기

Sub ExportRangetoFile()
'Update 20130913
Dim wb As Workbook
Dim saveFile As String
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
Application.DisplayAlerts = False
Set wb = Application.Workbooks.Add
WorkRng.Copy
wb.Worksheets(1).Paste
saveFile = Application.GetSaveAsFilename(fileFilter:="Text Files (*.txt), *.txt")
wb.SaveAs Filename:=saveFile, FileFormat:=xlText, CreateBackup:=False
wb.Close
Application.CutCopyMode = False
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub

3. 그런 다음 F5 이 코드를 실행하는 키입니다. 그런 다음 팝업 대화 상자에서 내보낼 데이터 범위를 선택하고 OK 버튼, 스크린 샷 참조 :
텍스트 파일로 내보낼 열을 하나 선택하십시오.

4. 이제 다른 이름으로 저장 대화 상자에서이 텍스트 파일의 이름과이 파일을 저장할 폴더를 지정하고 찜하기 버튼을 클릭합니다.


Excel 용 Kutools를 사용하여 선택 항목 (또는 하나의 열)을 텍스트 파일로 내보내기

XNUMXD덴탈의 다른 이름으로 저장 명령은 활성 워크 시트의 모든 데이터를 텍스트로 내보낼 수 있습니다. 지정된 비활성 워크 시트의 모든 데이터 또는 워크 시트의 데이터 일부를 텍스트 파일로 내 보내면 어떻게됩니까? Excel 용 Kutools's 범위를 파일로 내보내기 유틸리티를 사용하면 선택한 데이터를 텍스트 파일로 쉽게 내보내고 저장할 수 있습니다.  

Excel 용 Kutools - 300개 이상의 Excel용 필수 도구가 포함되어 있습니다. 신용카드 없이 모든 기능을 갖춘 30일 무료 평가판을 즐겨보세요! 지금 다운로드!

1. 텍스트 파일로 내보낼 범위를 선택하고 (이 경우에는 A 열을 선택합니다) 쿠툴즈 플러스 > 수입 수출 > 범위를 파일로 내보내기, 스크린 샷 참조 :
Excel 추가 기능 : 선택 항목을 텍스트 파일로 내보내기

2. . 범위를 파일로 내보내기 대화 상자에서 아래 스크린 샷과 같이 수행하십시오.
Excel 추가 기능 : 선택 항목을 텍스트 파일로 내보내기
(1) 확인 유니 코드 텍스트 에서 옵션 파일 형식 섹션;
(2) 텍스트 옵션 섹션에서 필요에 따라 실제 값 저장 옵션 또는 화면에 표시된대로 값 저장 옵션을 선택합니다.
(3) 내 보낸 텍스트 파일을 저장할 대상 폴더를 지정합니다.
(4) 클릭 Ok 버튼을 클릭합니다.

3. 새 열기 대화 상자에서 내 보낸 텍스트 파일의 이름을 지정하고 Ok 버튼을 클릭합니다.
내 보낸 텍스트 파일의 이름을 지정합니다.

그런 다음 선택 항목 (A 열 선택)이 텍스트 파일로 내 보내져 지정된 폴더에 저장됩니다.

Excel 용 Kutools - 300개 이상의 필수 도구로 Excel을 강화하세요. 신용카드 없이 모든 기능을 갖춘 30일 무료 평가판을 즐겨보세요! 이제 그것을 잡아


Excel에서 여러 시트를 별도의 텍스트 파일로 내보내기

때로는 여러 워크 시트를 Excel의 여러 텍스트 파일로 내 보내야 할 수 있습니다. 다른 이름으로 저장 기능은 약간 지루할 수 있습니다! 걱정 하지마! Excel 용 Kutools 통합 문서 분할 유틸리티는 Excel 사용자에게 몇 번의 클릭으로 여러 워크 시트를 여러 개별 텍스트 파일로 내보내는 쉬운 해결 방법을 제공합니다. 

Excel 용 Kutools - 300개 이상의 Excel용 필수 도구가 포함되어 있습니다. 신용카드 없이 모든 기능을 갖춘 30일 무료 평가판을 즐겨보세요! 지금 다운로드!

1. 클릭 쿠툴즈 플러스 > 통합 문서통합 문서 분할. 스크린 샷보기 :
Excel 추가 기능 : 여러 시트를 텍스트 파일로 내보내기

2. 통합 문서 분할 열기 대화 상자에서 다음과 같이하십시오.
Excel 추가 기능 : 여러 시트를 텍스트 파일로 내보내기
(1) 별도의 텍스트 파일로 내보낼 워크 시트를 통합 문서 이름 섹션;
(2) 확인 저장 형식 지정 옵션을 선택한 다음 유니 코드 텍스트 (* .txt) 아래 드롭 다운 목록에서 왼쪽 스크린 샷 참조 :
(3) 스플릿 버튼을 클릭합니다.

3. 그런 다음 폴더 찾아보기 대화 상자가 나타나면 내 보낸 텍스트 파일을 저장할 대상 폴더를 선택하고 OK 버튼을 클릭합니다.

지금까지 지정된 각 워크 시트를 별도의 텍스트 파일로 내보내고 지정된 폴더에 저장했습니다.

Excel 용 Kutools - 300개 이상의 필수 도구로 Excel을 강화하세요. 신용카드 없이 모든 기능을 갖춘 30일 무료 평가판을 즐겨보세요! 이제 그것을 잡아

Excel에서 각 시트를 별도의 PDF / 텍스트 / csv 파일 또는 통합 문서로 쉽게 대량 저장

일반적으로 다른 이름으로 저장 기능을 사용하여 활성 워크 시트를 별도의 .pdf 파일, .txt 파일 또는 .csv 파일로 저장할 수 있습니다. 그러나 Excel 용 Kutools 통합 문서 분할 유틸리티를 사용하면 각 통합 문서를 별도의 PDF / TEXT / CSV 파일 또는 Excel의 통합 문서로 쉽게 저장할 수 있습니다.


광고 분할 통합 문서 pdf 1

Excel 용 Kutools - 300개 이상의 필수 도구로 Excel을 강화하세요. 신용카드 없이 모든 기능을 갖춘 30일 무료 평가판을 즐겨보세요! 이제 그것을 잡아


데모 : Excel 데이터 (선택 또는 시트)를 Excel의 텍스트 파일로 내보내기


Excel 용 Kutools: 300개 이상의 편리한 도구를 손쉽게 사용할 수 있습니다! 지금 바로 기능 제한 없이 30일 무료 평가판을 시작해 보세요. 지금 다운로드!

관련 기사:

최고의 사무 생산성 도구

🤖 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 (19)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
How would I amend the code for Export selection (or one column) to text file with VBA to autofill the filename with the contents of cell B2?
thanks
This comment was minimized by the moderator on the site
Hi,This is great, thanks a lot.
How would I alter the code for Export selection (or one column) to text file with VBA to auto fill the filename with the contents of cell B2?
This comment was minimized by the moderator on the site
Hi, this code is very useful for me. So thank you very much.
I want to ask that: When i'm using this code, a new line append automatically at the end of the txt content.
Can you help me about preventing this by vba?
This comment was minimized by the moderator on the site
hi guys, i used that code:
Sub ExportRangetoFile()
'Update 20130913
Dim wb As Workbook
Dim saveFile As String
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
Application.DisplayAlerts = False
Set wb = Application.Workbooks.Add
WorkRng.Copy
wb.Worksheets(1).Paste
saveFile = Application.GetSaveAsFilename(fileFilter:="Text Files (*.txt), *.txt")
wb.SaveAs Filename:=saveFile, FileFormat:=xlText, CreateBackup:=False
wb.Close
Application.CutCopyMode = False
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub

and have working, but i need to savea column with cells that contain the function"concatenate", and when i play the vba code, and i save the .TXT file, only what appears it's #REF. how can i to fix it? cause i need the data that appears on that cells?
This comment was minimized by the moderator on the site
Has anyone been able to figure this out? I am having the same issue.
This comment was minimized by the moderator on the site
HELLO
THANK YOU FOR YOUR VBA CODE
SOMETIMES ON CERTAIN TEXT THERE IS "TEXT" IN EXPORT .TXT
THANK YOU FOR WHY
This comment was minimized by the moderator on the site
Thanks for the awesome piece of VBA code to export data to a text file. I have used your code with some of my own. The data I am dealing with is extremely line-length specific and after the macro has run, the text file contains some double quotation marks " at random places, which was never present in my data before. I have tried adding a code line to remove this character at various stages but that does not seem to be working. I am aware that I can manually remove this but would like to resolve it in the VBA code.

Sub Macro3()
Dim wb As Workbook
Dim saveFile As String
Dim WorkRng As Range
On Error Resume Next
Selection.AutoFilter
ActiveSheet.Range("$A$1:$B$10591").AutoFilter Field:=1, Criteria1:= _
"=NSZAP*", Operator:=xlAnd
Range("A1").Select
ActiveCell.Offset(200, 0).Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
ActiveCell.Rows("1:10101").EntireRow.Select
Selection.Delete Shift:=xlUp
Range("A1").Select
Selection.AutoFilter
Range(Selection, Selection.End(xlDown)).Select
Set WorkRng = Application.Selection
Set wb = Application.Workbooks.Add
WorkRng.Copy
wb.Worksheets(1).Paste
Selection.Replace What:="""", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
saveFile = Application.GetSaveAsFilename(fileFilter:="Text Files (*.txt), *.txt")
Selection.Replace What:="""", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
wb.SaveAs Filename:=saveFile, FileFormat:=xlText, CreateBackup:=False
Selection.Replace What:="""", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
wb.Close
Application.CutCopyMode = False
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
This comment was minimized by the moderator on the site
Hi Harish,
For removing a specified character in bulk, you can replace the character with nothing.
Ctrl + H to open the Find and Replace dialog box, type the specified character in the Find what box, and type noting in the replace with box.
This comment was minimized by the moderator on the site
3/2 You might also note that you don't need to specify the wb prefix once you've .Add ed the workbook since it becomes active. Specifying wb might or might not be more efficient but it can be omitted from some commands. Actually I entirely scrapped the variable wb; I just go Workbooks.Add, and use ActiveWorkbook when needed. (As you are suppressing ScreenUpdating it wouldn't be obvious to some that wb is Active. Tip for beginners (and higher): I always, always develop with ScreenUpdating and DisplayAlerts as True, and when done with development, I consider toggling them off for some passage of code.)
This comment was minimized by the moderator on the site
2/2 - vbYesNoCancel msgboxes and Booleans to indicate whether to export all, selection, or a user specified range - a static String for the prior range address - if len(that static)1 then I set WorkRng=activesheet.UsedRange (You can't copy multiple areas with a single copy, though with a little work you could walk the areas and copy them piecemeal.) - Idiotic Microsoft does not save off empty rows at the start and the bottom of the saved range, and does not save off empty columns at the leftmost and the rightmost of the saved range. When I detect that (UsedRange is not row 1, col. 1, or xlLastCell is not completely lower-right) I msgbox to ask user if they want to plug A1 or the lower right cell. - Then I decided to preemptively address the upper left issue by inserting a row and setting A1 to be text like "The following is for range " - I close with activeworkbook.close SaveChanges:=False - Long time habit since I'm an angry proponent of cleaning up (and the world is a sad place thanks to irresponsible programmers who shirk that responsibility when it matters), I set WorkRng = Nothing on the way out :)
This comment was minimized by the moderator on the site
1/2 (since your software limits comment length) I am a serious coder and I want to inform you that the VBA code here is outstanding. It's clean, and not one line too much, or one too few. It's exemplary coding for demonstration of the process. I'll also mention that as I extensively researched solutions for export of selection, you and only one other person suggested dropping the range into a temp new workbook. All other answers were painfully manually, walking through cell by cell. Even Chip's code is much longer and runs slower (but intentionally so, as it is much more flexible - specifiable delimiters, etc.) Just for your amusement, I made some very minor tweaks but otherwise nearly lifted the code word for word because it basically dropped right into a very intricate and specialized application. Some of these tweaks are something I'm sure you do in practice, but they add lines of code (e.g. error checking) so showing them on this webpage would have muddied your display so that the essential elements of processing would have been cumbersome for readers to follow along. Anyway: (see part 2)
This comment was minimized by the moderator on the site
My query is as mentioned below: I have a report to generate everyday. The data what I get on the final row (only one row but more than one columns) I want it to export to another excel sheet which is a summary excel sheet saved separately on my desktop. Eg: Day1 report - final row export to Summary excel sheet row1 Day2 report - final row export to Summary excel sheet row2 Day3 report - final row export to Summary excel sheet row3 and so on.. Export should be done through a click button., which means when I click on export button the data on the sheet I calculated today should go and save on the Summary excel sheet row1, next day a new excel sheet report calculated should go and save on the Summary excel sheet row2 and so on.. Will this be possible to do... If yes please someone help me on this... Thank you in advance...:-)
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