Sub SendEmailsToAllUniqueIDs()
Dim OutlookApp As Object
Dim MailItem As Object
Dim ws As Worksheet
Dim emailDict As Object
Dim cell As Range
Dim lastRow As Long
Dim email As String, data As String
Dim consolidatedData As String
' Set the worksheet
Set ws = ThisWorkbook.Sheets("Sheet1") ' Adjust sheet name if needed
' Get the last row in the Email ID column (column F in this example)
lastRow = ws.Cells(ws.Rows.Count, 6).End(xlUp).Row ' Assuming "Email ID" is in column F
' Create a dictionary to consolidate data by Email ID
Set emailDict = CreateObject("Scripting.Dictionary")
' Loop through the rows to consolidate data by email
For Each cell In ws.Range("F2:F" & lastRow) ' Assuming headers are in row 1
email = cell.Value
data = "Vendor: " & cell.Offset(0, -5).Value & ", Invoice: " & cell.Offset(0, -4).Value & _
", Amount: " & cell.Offset(0, -2).Value & ", Tenor: " & cell.Offset(0, -1).Value
If emailDict.exists(email) Then
emailDict(email) = emailDict(email) & vbCrLf & data
Else
emailDict.Add email, data
End If
Next cell
' Initialize Outlook
On Error Resume Next
Set OutlookApp = GetObject(, "Outlook.Application")
If OutlookApp Is Nothing Then
Set OutlookApp = CreateObject("Outlook.Application")
End If
On Error GoTo 0
' Loop through the dictionary and send emails
For Each email In emailDict.keys
' Create a new email
Set MailItem = OutlookApp.CreateItem(0)
With MailItem
.To = email
.Subject = "Consolidated Invoice Information"
.Body = "Hello," & vbCrLf & vbCrLf & _
"Here is your consolidated invoice information:" & vbCrLf & _
emailDict(email) & vbCrLf & vbCrLf & _
"Best regards," & vbCrLf & "Your Name"
.Send ' Use .Display instead of .Send to preview the email
End With
Next email
' Cleanup
MsgBox "Emails sent successfully!"
Set MailItem = Nothing
Set OutlookApp = Nothing
Set emailDict = Nothing
End Sub
IPconfigEarth
Monday, 2 December 2024
test how to send excel range
Wednesday, 5 July 2017
Thursday, 24 September 2015
Should you jailbreak an iPhone?
After more than 250,000 jailbreakers see their data stolen by the KeyRaider breach, Wait that is not true!
truth about KeyRaider and iOS jailbreaking
Firstly,
What is Jailbreaking?
Jailbreaking is the process of removing hardware restrictions imposed by iOS, Apple's operating system, on devices running it through the use of software exploits; such devices include the iPhone, iPod touch, iPad, and second-generation Apple TV.
Jailbreaking is different to iPhone unlocking.
iPhones (like most mobile phones) that are sold as part of a contract
are often locked to a particular network. This means that if you buy an
iPhone from Company X, for example, you have to use an Comany X SIM card in it. The
iPhone is 'locked' to that network. Unlocking the iPhone turns it from
an iPhone that can only work on the Company X network to one that can work on
any network. But you will still be running officially sanctioned iOS
software, and still have the software limitations. (Unlocking is
considered a breach of your mobile phone contract, incidentally.)
Now, more than 250,000 jailbreakers see their
data stolen by the KeyRaider breach, That is NOT TRUE...
the truth is that there are millions of jailbreakers and even more phones jailbroken.
Tuesday, 22 October 2013
Bbm issue today 22nd oct 2013
There are rare but exists errors in apps.. even uninstalling or re installing will not work...
What will??
Hold on for the fix...
Sunday, 10 March 2013
Monday, 5 November 2012
pain of hunger
About 40% of the humans live in poverty... seems our financial systems, political systems are just a joke...
The picture shows the hunger of SO many beings and
a feeling that these people feel everyday
you know what should be done
dont wait for the change
be it!
.
if you are looking for a path.. and want to help these people...
.
.
read on
.
Tuesday, 23 October 2012
Subscribe to:
Posts (Atom)