Trigger email to Indidudula User for leave request

Guna13

Board Regular
Joined
Nov 22, 2019
Messages
70
Office Version
  1. 365
Platform
  1. Windows
Hello,

After Multiple tried, i did few code work, based on data. But I am not able to create emails for List of Users one by one Instead Single shot email for all Users?

If No User data, then No need to Send email. Kindly suggest me.


I need to send email to Individual Users with Body of contain in that Each Line with Header Wise.

Request you to make short Macro code, instead of my code is lengthy code.

Sub Macro1()
Dim sToday As String

Set Sh = Sheet1
Set Ws = Sheet2

Ws.Cells.Clear

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

Trgv = "Earn Leave"
sToday = Format(Date + 1, "MMM-DD")
Sh.Activate
Sh.Cells.Find(What:=sToday, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate

Sh.Range("A1:A" & lr, "C1:C" & lr).Copy Ws.Range("A1")

ActiveCell.EntireColumn.Copy Sheets("Sheet2").Cells(1, 4)
Application.CutCopyMode = False

lr = Ws.Cells(Rows.Count, 1).End(xlUp).Row
For i = lr To 2 Step -1
If Ws.Range("D" & i) <> "Earn Leave" Then
Ws.Range("D" & i).EntireRow.Delete
End If
Next i
End Sub

LocationStaff No.NameDec-12
India
13242143213​
ANBUVEL BLALAJIEarn Leave
India
21432142314​
AISHWEARYA RKDIASFDEarn Leave
India
12343214321​
RAVEENA EDELVALVEarn Leave
India
21343214123​
KRITHIKA MANIASFLASFDEarn Leave
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Forum statistics

Threads
1,215,475
Messages
6,125,028
Members
449,205
Latest member
Eggy66

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top