메인 컨텐츠로 가기

Excel 셀의 날짜를 기준으로 이메일을 빠르게 보내는 방법은 무엇입니까?

Excel 셀의 날짜를 기준으로 이메일을 보내려고 한 적이 있습니까? 예를 들어, 다음은 A 열의 날짜 목록입니다. 제목, 메시지 본문이 포함 된 이메일을 수신자에게 보내려고합니다 (다른 사람에게 참조 및 숨은 참조도 가능). 어떻게 처리 할 수 ​​있습니까?

VBA로 날짜를 기준으로 이메일 보내기


VBA로 날짜를 기준으로 이메일 보내기

Excel에서 날짜를 기준으로 이메일을 보내려면 매크로 코드 만 적용하면됩니다.

1. 사용하는 데이터와 날짜가 포함 된 시트를 활성화하고 Alt + F11 활성화하는 키 응용 프로그램 용 Microsoft Visual Basic 창.

2. 클릭 끼워 넣다 > 모듈을 클릭하고 코드 아래 빈 스크립트에 붙여 넣습니다. 

VBA : 날짜로 보내기

Sub email()
'UpdatebyExtendoffice20170831
    Dim xRg As Range
    Dim xRgEach As Range
    Dim xAddress As String
    Dim xEmail_Subject, xEmail_Send_From, xEmail_Send_To, xEmail_Cc, xEmail_Bcc, xEmail_Body As String
    Dim xMail_Object, xMail_Single As Object
    On Error Resume Next
    xAddress = ActiveWindow.RangeSelection.Address
    Set xRg = Application.InputBox("Select a range:", "KuTools For Excel", xAddress, , , , , 8)
    If xRg Is Nothing Then Exit Sub
    For Each xRgEach In xRg
        If xRgEach.Value = Date Then
            xEmail_Subject = Application.InputBox("Subject: ", "Kutools", , , , , , 2)
            xEmail_Send_From = Application.InputBox("Send from: ", "KuTools For Excel", , , , , , 2)
            xEmail_Send_To = Application.InputBox("Send to: ", "KuTools For Excel", , , , , , 2)
            If xEmail_Send_To = "" Then Exit Sub
            xEmail_Cc = Application.InputBox("CC: ", "KuTools For Excel", , , , , , 2)
            xEmail_Bcc = Application.InputBox("BCC: ", "KuTools For Excel", , , , , , 2)
            xEmail_Body = Application.InputBox("Message Body: ", "KuTools For Excel", , , , , , 2)
            Set xMail_Object = CreateObject("Outlook.Application")
            Set xMail_Single = xMail_Object.CreateItem(0)
            With xMail_Single
                .Subject = xEmail_Subject
                .To = xEmail_Send_To
                .cc = xEmail_Cc
                .BCC = xEmail_Bcc
                .Body = xEmail_Body
                .Send
            End With
        End If
    Next
End Sub

3. 클릭 달리기 버튼을 누르거나 누르십시오. F5 키를 눌러 코드를 실행하면 날짜 목록을 선택하라는 대화 상자가 나타납니다. 스크린 샷보기 :
문서 전송 날짜 1

4. 확인을 클릭하고 계속해서 이메일 제목, 보낸 사람의 이메일 주소,받는 사람의 이메일 주소, 참조, 숨은 참조 및 메시지 본문을 지정합니다. 스크린 샷보기 :

문서 전송 날짜 2 샷 화살표 오른쪽 문서 전송 날짜 3 샷 화살표 오른쪽 문서 전송 날짜 4
        문서 아래쪽 화살표
문서 전송 날짜 7 왼쪽 샷 화살표 문서 전송 날짜 6 왼쪽 샷 화살표 문서 전송 날짜 5

5. 클릭 OK > OK 마지막까지 이메일이 전송되었습니다.
문서 전송 날짜 8

참고 : 보낸 사람의 전자 메일 주소는 Outlook의 기본 계정이어야합니다.


메일 링리스트 생성 및 이메일 보내기

doc 이메일 보내기

최고의 사무 생산성 도구

🤖 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 (16)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
When I click run the date an I am asked to select a range nothing happens after I click ok?
This comment was minimized by the moderator on the site
Hi, jason, you need to select a cell or range that contains date(s), if the selected cell or range is empty or not contains date(s), the macro will exit.
This comment was minimized by the moderator on the site
Hi,


That is perfect, but when I add or change a date, it wont send the email Automatiklicht, I have to run the code again and by that I have to choose date range, sender, receiver and all info again. is there anyway to solve this issue?
This comment was minimized by the moderator on the site
its not going on next xRgEach if i am having same dates multiple times, its sending mails to same user multiple times.
This comment was minimized by the moderator on the site
Hi, vaibhav, you can remove the duplicate times by using Remove Duplicates feature in Data Tools under Data tab, then using the VBA.
This comment was minimized by the moderator on the site
Çok teşekkür ederim..
This comment was minimized by the moderator on the site
Merhaba, bir excel dosyasında hatırlatıcı olarak bu konuyla ilgili VSB nin nasıl yapıldığı ile ilgili bilgiye ihtiyacım var. Örneğin boş bir hücreye bilgi girildiğinde bana mail at ya da 3 hafta sıklıkla hücreye bilgi girilip girilmediğiyle alakalı bana bilgi ver.

Hertürlü bilgi ve kaynağa açığım. Şimdiden herkese teşekkür ederim..
This comment was minimized by the moderator on the site
Hi, Mehmet, here is a tutorial How To Send Email If A Certain Cell Is Modified In Excel? that talking about sending an email with the excel file as attachment if the cells in the specific range are modified, which may help you.
This comment was minimized by the moderator on the site
Bonjour j'ai copié les codes, à la validation il me demande bien les cellules concernées, mais lorsque que je valide, il ne me propose pas la suite des fenêtres, sujets, adresses etc
This comment was minimized by the moderator on the site
Hi, boutry, sorry I that reply with English since I do not know French. May I know your date time format? I guess maybe the code only work for datetime in English date format.
This comment was minimized by the moderator on the site
The boxes do not automatically populate after I hit OK. Where do I change the subject, email address and body of the email in the code?
This comment was minimized by the moderator on the site
holagracias por tu ayuda...tengo una consulta.....en la formula Set xRgDate = Application.InputBox("Please select the due date column:", "KuTools For Excel", , , , , , 8), el 8 que significa?
This comment was minimized by the moderator on the site
Felicidades por el material; pero no me funciona. Al parecer el Rango no se llena, por ende queda vacío y sale de la rutina.

Alguna corrección ?
This comment was minimized by the moderator on the site
This is close to what I need but I am stuck with two problems. 1st I need to run this across my entire workbook that gets new worksheets added daily. 2nd I need it to include the worksheet name in the email so I will know which sheet is due. I create new tickets (worksheets) with a field that is a future date, when that day arrives I need an email. Thank you for your help.
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