메인 컨텐츠로 가기

지정된 범위를 복사하여 Excel의 이메일 본문에 붙여 넣어 이메일을 보내는 방법은 무엇입니까?

대부분의 경우 Excel 워크 시트에 지정된 범위의 내용이 전자 메일 통신에 유용 할 수 있습니다. 이 기사에서는 Excel에서 직접 이메일 본문에 지정된 범위를 붙여 넣은 이메일을 보내는 방법을 소개합니다.

Excel의 이메일 본문에 지정된 범위를 붙여 넣은 이메일 보내기
놀라운 도구를 사용하여 지정된 범위를 이메일 본문에 붙여 넣은 이메일 보내기

Excel 메일 링에 대한 추가 자습서 ...


Excel의 이메일 본문에 지정된 범위를 붙여 넣은 이메일 보내기

다음 VBA 코드를 사용하면 범위를 복사하여 Excel에서 직접 Outlook 전자 메일 본문에 붙여 넣을 수 있습니다. 다음과 같이하십시오.

1. 복사해야하는 범위가있는 워크 시트에서 다른 + F11 동시에 열려면 키 응용 프로그램 용 Microsoft Visual Basic 창.

2. 오프닝에서 응용 프로그램 용 Microsoft Visual Basic 창을 클릭하십시오 도구 > 참고자료 아래 스크린 샷과 같이.

3. 에서 참조 – VBAProject 대화 상자를 찾아서 확인하십시오. Microsoft Outlook 개체 라이브러리 옵션을 클릭 한 다음 OK 버튼을 클릭합니다.

4. 클릭 끼워 넣다 > 모듈을 클릭 한 다음 아래 VBA 코드를 복사하여 모듈 창에 붙여 넣습니다.

VBA 코드 : Excel의 전자 메일 본문에 붙여 넣은 지정된 범위로 전자 메일 보내기

Sub Send_Email()
'Updated by Extendoffice 20200119
    Dim xRg As Range
    Dim I, J As Long
    Dim xAddress As String
    Dim xEmailBody As String
    Dim xMailOut As Outlook.MailItem
    Dim xOutApp As Outlook.Application    
    On Error Resume Next
    xAddress = ActiveWindow.RangeSelection.Address
    Set xRg = Application.InputBox("Please select range you need to paste into email body", "KuTools For Excel", xAddress, , , , , 8)
If xRg Is Nothing Then Exit Sub
Application.ScreenUpdating = False
    Set xOutApp = CreateObject("Outlook.Application")
    Set xMailOut = xOutApp.CreateItem(olMailItem)
    For I = 1 To xRg.Rows.Count
        For J = 1 To xRg.Columns.Count
            xEmailBody = xEmailBody & "  " & xRg.Cells(I, J).value
        Next
        xEmailBody = xEmailBody & vbNewLine
    Next
    xEmailBody = "Hi" & vbLf & vbLf & " body of message you want to add" & vbLf & vbLf & xEmailBody & vbNewLine
    With xMailOut
        .Subject = "Test"
        .To = ""
        .Body = xEmailBody
        .Display
        '.Send
    End With
    Set xMailOut = Nothing
    Set xOutApp = Nothing
    Application.ScreenUpdating = True
End Sub

노트:

  • 1). 이메일 본문을 변경하십시오. xEmailBody = "안녕하세요"& vbLf & vbLf & "추가 할 메시지 본문"& vbLf & vbLf & xEmailBody & vbNewLine 필요에 따라
  • 2). 이메일 수신자와 제목 (.까지 = .Subject = "테스트") 코드의 줄.

5. 누르세요 F5 코드를 실행하는 키입니다. 팝업에서 Excel 용 Kutools 대화 상자에서 이메일 본문에 붙여 넣을 범위를 선택한 다음 OK 단추. 스크린 샷보기 :

6. 이제 지정된 수신자, 제목, 본문 및 선택한 Excel 범위로 이메일이 생성됩니다. 전송 이 이메일을 보내려면 버튼을 누르세요. 표시된 스크린 샷을 참조하십시오.

주의 사항: VBA 코드는 Outlook을 전자 메일 프로그램으로 사용할 때만 작동합니다.


놀라운 도구를 사용하여 지정된 범위를 이메일 본문에 붙여 넣은 이메일 보내기

Outlook을 사용하지 않고 지정된 범위 데이터를 내부에 붙여 넣은 상태로 Excel에서 직접 이메일을 보내려면 다음을 적극 권장합니다. 이메일 보내기 ~의 유용성 Excel 용 Kutools 당신을 위해. 이 기능을 사용하면 이메일 주소의 발신 서버를 구성한 다음 나중에이 이메일 주소를 통해 직접 Excel에서 이메일을 보내면됩니다.

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

1. 먼저 필요한 필드가있는 메일 링리스트를 준비해야합니다.

  • 방문 꿀팁: 메일 링리스트는 최소한 2 개의 행을 포함해야하며 첫 번째 행은 헤더 여야합니다 (Excel에서 두 개의 이메일 주소로 이메일을 보내려는 경우 아래 스크린 샷과 같이 헤더 "Email"과 함께이 두 이메일 주소를 입력하십시오. ).
  • 또는 다음을 사용하여 메일 링리스트를 쉽게 만들 수 있습니다. 메일 링리스트 생성 기능.

2. 이메일 본문에 데이터를 추가 할 범위를 선택하고 Ctrl 키 + C 키를 눌러 복사하십시오.

3. 전체 메일 링리스트 (헤더 포함)를 선택하고 쿠툴즈 플러스 > 이메일 보내기. 스크린 샷보기 :

4. 그런 다음 이메일 보내기 대화 상자가 나타납니다.

  • 4.1) 선택한 메일 링리스트의 항목이 해당 필드에 채워집니다 (필요에 따라 메일 링리스트에 필드를 더 추가 할 수 있음).
  • 4.2) 이메일 본문 상자를 클릭하고 Ctrl 키 + V 키를 눌러 선택한 범위 데이터를 붙여 넣습니다. 그 후 필요에 따라 다른 콘텐츠를 추가하십시오.
  • 4.3 체크 해제 Outlook을 통해 이메일 보내기 상자;
  • 2.4) 클릭 보내는 서버 설정 단추. 스크린 샷보기 :

5. 그런 다음 보내는 서버 (SMTP) 설정 – 새 체계 대화 상자가 나타납니다. 서버 설정으로 이메일 주소를 입력하고 확인 후 발송 된 모든 메일을 저장할 폴더를 지정하십시오. 보낸 이메일 저장 상자를 클릭 한 다음 OK 버튼을 눌러 설정을 저장하십시오.

6.로 돌아갈 때 이메일 보내기 대화 상자에서 전송 버튼을 눌러 이메일을 보냅니다.

이제부터는이 기능을 사용하여 Excel에서 직접 이메일을 보낼 수 있습니다.

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


관련 기사 :

Excel의 셀에 지정된 이메일 주소로 이메일 보내기
전자 메일 주소 목록이 있고 Excel에서 직접 이러한 전자 메일 주소로 전자 메일 메시지를 대량으로 보내려고한다고 가정합니다. 그것을 달성하는 방법? 이 기사에서는 Excel의 셀에 지정된 여러 이메일 주소로 이메일을 보내는 방법을 보여줍니다.

Excel에서 전자 메일을 보낼 때 Outlook 서명 삽입
Excel에서 직접 이메일을 보내려는 경우 이메일에 기본 Outlook 서명을 어떻게 추가 할 수 있습니까? 이 문서에서는 Excel에서 전자 메일을 보낼 때 Outlook 서명을 추가하는 데 도움이되는 두 가지 방법을 제공합니다.

Excel에 첨부 된 여러 첨부 파일이있는 전자 메일 보내기
이 기사에서는 Excel에 여러 첨부 파일이 첨부 된 Outlook을 통해 전자 메일을 보내는 방법에 대해 설명합니다.

Excel에서 기한이 충족되면 전자 메일 보내기
예를 들어 C 열의 기한이 7 일 이하인 경우 (현재 날짜는 2017/9/13) A 열의 지정된 수신자에게 B 열에 지정된 내용과 함께 이메일 알림을 보냅니다. 방법 그것을 이루다? 이 기사에서는 VBA 방법을 자세히 설명합니다.

Excel의 셀 값에 따라 자동으로 이메일 보내기
Excel의 지정된 셀 값을 기반으로 Outlook을 통해 특정 수신자에게 이메일을 보내려고한다고 가정합니다. 예를 들어 워크 시트의 D7 셀 값이 200보다 크면 전자 메일이 자동으로 생성됩니다. 이 기사에서는이 문제를 빠르게 해결할 수있는 VBA 방법을 소개합니다.

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 (22)
Rated 4.5 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
The only issue is that the format of the table is not maintained in the mail. Can you let me know how do we preserve the format of the table in the mail, I have the same issue, could you see if you could update it please, otherwise this is excellent.
Many thanks
Rated 4.5 out of 5
This comment was minimized by the moderator on the site
Hi Andy Mitchell,
If you want to maintain the format of the table, the following VBA script can do you a favor. Please give it a try. Thank you.
Sub Send_Email()
'Updated by Extendoffice 20220616
    Dim xRg As Range
    Dim I, J As Long
    Dim xAddress As String
    Dim xMailOut As Object
    Dim xOutApp As Object
    On Error Resume Next
    Set xOutApp = CreateObject("Outlook.Application")
    Set xMailOut = xOutApp.CreateItem(olMailItem)
    xAddress = ActiveWindow.RangeSelection.Address
    Set xRg = Application.InputBox("Please select range you need to paste into email body", "KuTools For Excel", xAddress, , , , , 8)
If xRg Is Nothing Then Exit Sub
Application.ScreenUpdating = False
    Set xOutApp = CreateObject("Outlook.Application")
    Set xMailOut = xOutApp.CreateItem(olMailItem)
    With xMailOut
        .Subject = "Test"
        .To = ""
        .HTMLBody = RangetoHTML(xRg)
        .Display
        '.Send
    End With
    Set xMailOut = Nothing
    Set xOutApp = Nothing
    Application.ScreenUpdating = True
End Sub

 ' The following VBA script is cited from this page:
 ' https://stackoverflow.com/questions/18663127/paste-excel-range-in-outlook
Function RangetoHTML(rng As Range)
' By Ron de Bruin.
    Dim fso As Object
    Dim ts As Object
    Dim TempFile As String
    Dim TempWB As Workbook

    TempFile = Environ$("temp") & "/" & Format(Now, "dd-mm-yy h-mm-ss") & ".htm"

    'Copy the range and create a new workbook to past the data in
    rng.Copy
    Set TempWB = Workbooks.Add(1)
    With TempWB.Sheets(1)
        .Cells(1).PasteSpecial Paste:=8
        .Cells(1).PasteSpecial xlPasteValues, , False, False
        .Cells(1).PasteSpecial xlPasteFormats, , False, False
        .Cells(1).Select
        Application.CutCopyMode = False
        On Error Resume Next
        .DrawingObjects.Visible = True
        .DrawingObjects.Delete
        On Error GoTo 0
    End With

    'Publish the sheet to a htm file
    With TempWB.PublishObjects.Add( _
         SourceType:=xlSourceRange, _
         Filename:=TempFile, _
         Sheet:=TempWB.Sheets(1).Name, _
         Source:=TempWB.Sheets(1).UsedRange.Address, _
         HtmlType:=xlHtmlStatic)
        .Publish (True)
    End With

    'Read all data from the htm file into RangetoHTML
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set ts = fso.GetFile(TempFile).OpenAsTextStream(1, -2)
    RangetoHTML = ts.ReadAll
    ts.Close
    RangetoHTML = Replace(RangetoHTML, "align=center x:publishsource=", _
                          "align=left x:publishsource=")

    'Close TempWB
    TempWB.Close savechanges:=False

    'Delete the htm file we used in this function
    Kill TempFile

    Set ts = Nothing
    Set fso = Nothing
    Set TempWB = Nothing
End Function
This comment was minimized by the moderator on the site
This worked perfectly, thank you so much.
I can now add my spin on it to get it doing what I need.
This comment was minimized by the moderator on the site
Hi Paul Johnson,

Very happy to help you solve the problem. Have a good day at work.
This comment was minimized by the moderator on the site
hello,
can you help me on below
I have create excel sheet & updated 10 supplier mail detailI have send mail through excel to all 10 supplier with individual sheet attachment with individual mail.
I want to paste excel data in outlook body instead of attachment in mail
can any one help me
This comment was minimized by the moderator on the site
Hi,
Instead of selecting the range, I want to select multiple pivots in the excel.
can you please help me.
This comment was minimized by the moderator on the site
Hi,
Instead of selecting the range manually, I want to select the range automatically.
This comment was minimized by the moderator on the site
Hi Raman,
In the below code, please replace the range "A1:C5" in line Set xRg = Range("A1:C5") with your own range.

Sub Send_Email()
Dim xRg As Range
Dim I, J As Long
Dim xAddress As String
Dim xEmailBody As String
Dim xMailOut As Outlook.MailItem
Dim xOutApp As Outlook.Application
On Error Resume Next
xAddress = ActiveWindow.RangeSelection.Address
Set xRg = Range("A1:C5")
If xRg Is Nothing Then Exit Sub
Application.ScreenUpdating = False
Set xOutApp = CreateObject("Outlook.Application")
Set xMailOut = xOutApp.CreateItem(olMailItem)
For I = 1 To xRg.Rows.Count
For J = 1 To xRg.Columns.Count
xEmailBody = xEmailBody & " " & xRg.Cells(I, J).Value
Next
xEmailBody = xEmailBody & vbNewLine
Next
xEmailBody = "Hi" & vbLf & vbLf & " body of message you want to add" & vbLf & vbLf & xEmailBody & vbNewLine
With xMailOut
.Subject = "Test"
.To = ""
.Body = xEmailBody
.Display
'.Send
End With
Set xMailOut = Nothing
Set xOutApp = Nothing
Application.ScreenUpdating = True
End Sub
This comment was minimized by the moderator on the site
Hi experts, Do we have updates on how the format maintained?
This comment was minimized by the moderator on the site
Hi Ther,
Can't figure it out. Sorry for that.
This comment was minimized by the moderator on the site
i am seeing a compile error (User-defined type not defined". Please help me out to overcome this.
This comment was minimized by the moderator on the site
Hi,
Please get into the Reference window by clicking Tools > references. Scroll down to find and check the Microsoft Outlook Object Library box and click the OK button to finish the setting.
This comment was minimized by the moderator on the site
this is pasting as a text. Kindly suggest how to send the table or the same format which is copied from the excel.
This comment was minimized by the moderator on the site
Code to send automatically after selecting after ok
This comment was minimized by the moderator on the site
Hi
This code is vary excellent, by using the code i have completed my 90% of my project.
I have same issue as mentioned by Anirudh that is table formatting. How can i format the table in email.
Please help me......
This comment was minimized by the moderator on the site
Good Day,
The problem can't be solved yet. Sorry for the inconvenience and thank you for your comment.
This comment was minimized by the moderator on the site
Hi, Is there any update on below.......
This comment was minimized by the moderator on the site
Hi, Also I Wanted code for "Filter by Date".
I am working on project, on that project I wanted to filter the data by the date, actually we have filter/hide the and last 05 days to current date data and we have highlight all other data.
Please help me to complete this project.
Your help is very great-full for me.
This comment was minimized by the moderator on the site
This is great. It is working as expected. The only issue is that the format of the table is not maintained in the mail. Can you let me know how do we preserve the format of the table in the mail
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