Рет қаралды 1,857
You can always take help from Chat GPT and eliminate your manual efforts within few seconds. in this video we will show you how to reduce manual efforts just by following few simple steps.
we can create multiple codes through Chat GPT and past that in excel to excuse our manual task.
Please find attached VBA code for your reference - Sub SendEmails()
Dim OutlookApp As Object
Dim OutlookMail As Object
Dim RecipientsRange As Range
Dim RecipientCell As Range
Dim MailBody As String
Dim ws As Worksheet
Dim lastRow As Long
Dim i As Long
' Create Outlook application
Set OutlookApp = CreateObject("Outlook.Application")
' Set the body text for the email
MailBody = "Hi All," & vbCrLf & vbCrLf & _
"Hope you are doing well." & vbCrLf & vbCrLf & _
"Please find attrition data with employee details." & vbCrLf & vbCrLf & _
"Thanks" & vbCrLf & "MIS Team"
' Set the worksheet containing the data
Set ws = ThisWorkbook.Sheets("Sheet1")
' Find the last row in column G
lastRow = ws.Cells(ws.Rows.Count, "G").End(xlUp).Row
' Loop through each row in column G
For i = 1 To lastRow
' Check if column A contains "Yes"
If ws.Cells(i, "A").Value = "Yes" Then
' Create new mail item
Set OutlookMail = OutlookApp.CreateItem(0)
' Compose email
With OutlookMail
.To = ws.Cells(i, "G").Value ' Set recipient email address
.Subject = "Important - Attrition Data" ' Set email subject
.Body = MailBody & vbCrLf & vbCrLf & "Details:" & vbCrLf & _
"Attrition: " & ws.Cells(i, "A").Value & vbCrLf & _
"Business Travel: " & ws.Cells(i, "B").Value & vbCrLf & _
"CF_attrition label: " & ws.Cells(i, "C").Value & vbCrLf & _
"Department: " & ws.Cells(i, "D").Value & vbCrLf & _
"Joining Date: " & ws.Cells(i, "E").Value & vbCrLf & _
"emp Name: " & ws.Cells(i, "F").Value ' Set email body with row content
' Add any attachments if needed: .Attachments.Add "C:\Path\To\Your\File.xlsx"
.Send ' Send the email
End With
' Release Outlook mail object
Set OutlookMail = Nothing
End If
Next i
' Release Outlook application object
Set OutlookApp = Nothing
' Inform user that emails have been sent
MsgBox "Emails have been sent successfully.", vbInformation
End Sub
*********FOLLOW ON*************
Facebook :- / excelworldofknowledge
Twitter - / sohandey3
Instagram :- / gyanontube
Telegram :- t.me/Gyanontube
______________________
POWER BI
Power BI In Excel In hindi :- • Power BI In Excel In h...
How to use Power Bi from beginner to advanced :- • Power Bi in hindi || H...
Power Bi में अपना काम सेव एंड रिकॉर्ड करे :- • Power Bi in Excel in h...
Power bi tutorial for beginners :- • Power bi tutorial for ...
Power BI dashboard :- • Microsoft Power BI In ...
Microsoft power bi in hindi :- • Power Bi tutorial for ...
Microsoft power bi course for free :- • Power Bi for beginners...
Delete unwanted columns in power bi :- • power bi tutorial for ...
Text to column in power bi for beginners :- • Text to column in powe...
Power BI with New Icon in 2020 :- • Power BI with New Icon...
Power Bi Reference option :- • Power Bi Reference opt...
Edit Data in power bi manually :- • Edit Data in power bi ...
power bi tutorial for beginners in hindi :- • power bi tutorial for ...
power bi dax tutorial for beginners :- • power bi dax tutorial ...
Power BI relationships between tables :- • Power BI relationships...
Excel formula
How to use index match formula from Basic to advance :- • index match excel || H...
How to make big formula in excel in hindi :- • combination formula ||...
Xlookup and Filter formula in hindi :- • Xlookup for Free || Ne...
How to reduce excel file size :- • compress excel file ||...
How to use Xlookup in excel :- • How to use Xlookup in ...
xlookup formula in hindi :- • How to use Xlookup in ...
array function in excel :- • Array formula excel ||...
New Xlookup with Search Mode :- • xlookup in excel in hi...
Xmatch formula in excel in hindi :- • Xmatch formula in exce...
how to use filter formula in excel in hindi :- • filter formula in exce...
Excel formulas and functions:- • Top 10 excel formulas ...
How to use excel unique function:- • How to use excel uniqu...
Sort formula in excel :- • Sort formula in excel ...
Gyan On Tube Excel