Call cell value Macro

karldugan

New Member
Joined
May 10, 2016
Messages
47
Hi all, I have a macro that will send an email automatically, but I can't get it to include the CC. I am guessing I have to "get" the value in Worksheets rather than just set it :/

Any help greatly appreciated.

Sub A2_Decline()

Set Authoriser1 = Worksheets("Process").Range("B5")
Set Authoriser2 = Worksheets("Process").Range("C5")
Set Authoriser3 = Worksheets("Process").Range("D5")
Set Authoriser4 = Worksheets("Process").Range("E5")

Dim OutApp As Object
Dim OutMail As Object

' Create a new Outlook instance
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0) ' 0 represents a mail item

' Compose the email
With OutMail
.To = Range("I12") & "@email.co.uk" ' Replace with the recipient's email address
.CC = Authoriser1 'Should be the email of the authoriser, this is set in the Process tab.
.Subject = "Approval Request " & Range("I4") & " : Declined" ' Replace with your email subject
.Body = "This has been declined. " & InputBox("This has been declined because...")
.Attachments.Add wb1.FullName
.Send
End With

' Clean up
Set OutMail = Nothing
Set OutApp = Nothing


End Sub
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

Forum statistics

Threads
1,221,290
Messages
6,159,047
Members
451,534
Latest member
zooster

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