Can anyone help me with some excel vba code to send emails from excel. I already have some rough code but I have two email addresses I like to send from. I prefer to have the send from email address in the excel file so i don't need to code it all the time. I tried using Ron Bruin's site but not sure that is current with my version of excel or outlook. Can anyone help me with some basic code. Below is what I have which works except for the send from part. I tried using the send on behalf option and later tried the sendusingaccount code but I honestly don't know this type of detail coding.

Sub Send_Email_With_Attachment()


'set up using email program
Dim outlookApp As Object
Dim outlookMail As Object


'Set up the recipients
Dim recipient1 As String
recipient1 = Worksheets("4Q-20").Range("b17")


'Set up the recipients
Dim CC1 As String
CC1 = Worksheets("4Q-20").Range("b18")


'set up the sender (optional)
Dim frm1 As String
frm1 = Worksheets("4Q-20").Range("b20")


'set up the subject
Dim subject As String
subject = Worksheets("4Q-20").Range("b19")


'Set up the email body message
Dim strbody As String
strbody = Worksheets("4Q-20").Range("b21")


'Set up file locations and name by referencing them from 4Q-20
Dim file1 As String
file1 = Worksheets("4Q-20").Range("b15")


Dim file2 As String
file2 = Worksheets("4Q-20").Range("b16")


'----------------------------------------------


Set outlookApp = CreateObject("outlook.application")
Set outlookMail = outlookApp.createitem(0)


With outlookMail


.To = recipient1
.CC = CC1
'.subject = "Line of Credits Update"
.subject = subject
.BodyFormat = 2
.HTMLBody = strbody
'.Attachments.Add file1
'.Attachments.Add file2
.sentOnbehalfofName = frm1
.Display
'.Send


End With


Set outlookMail = Nothing
Set outlookApp = Nothing




End Sub