I have some code that used the active worksheet from which it would send out emails listed in a range of cells in the active worksheet.
Now I want to be able to do this but now I have the email addresses in another worksheet in a named range.
I am unable to write the VBA to get the addresses from the named range on anther worksheet.
Below is the current Piece of the VBA that was being used to get the email addresses.
The piece of code I think I need to change is in red Below
The named range is called "Others" on the "Email Addresses" work sheet
Cheers
NZAS
Create a PDF from the current sheet and email it as an attachment through Outlook
Dim EmailSubject As String, EmailSignature As String
Dim CurrentMonth As String, DestFolder As String, PDFFile As String
Dim Email_To As String, Email_CC As String, Email_BCC As String
Dim OpenPDFAfterCreating As Boolean, AlwaysOverwritePDF As Boolean, DisplayEmail As Boolean
Dim OverwritePDF As VbMsgBoxResult
Dim OutlookApp As Object, OutlookMail As Object
Dim Recipients, f
CurrentMonth = ""
' *****************************************************
' ***** You Can Change These Variables *********
EmailSubject = "Dispatch Sheet " 'Change this to change the subject of the email. The current month is added to end of subj line
OpenPDFAfterCreating = False 'Change this if you want to open the PDF after creating it : TRUE = Yes or FALSE = No
AlwaysOverwritePDF = False 'Change this if you always want to overwrite a PDF that already exists :TRUE or FALSE
DisplayEmail = True 'Change this if you don't want to display the email before sending. True =Yes, False=No, Note,
'you must have a TO email address specified for this to work
Recipients = ActiveSheet.Range("R84:R86") 'Change this if you want to specify To email e.g. ActiveSheet.Range("H1") to get email from cell H1
For f = 1 To UBound(Recipients)
Email_To = Email_To & Recipients(f, 1) & "; "
Next f
Email_CC = "" 'Change this if you want to specify To email
Email_BCC = "" 'Change this if you want to specify To email
Now I want to be able to do this but now I have the email addresses in another worksheet in a named range.
I am unable to write the VBA to get the addresses from the named range on anther worksheet.
Below is the current Piece of the VBA that was being used to get the email addresses.
The piece of code I think I need to change is in red Below
The named range is called "Others" on the "Email Addresses" work sheet
Cheers
NZAS
Create a PDF from the current sheet and email it as an attachment through Outlook
Dim EmailSubject As String, EmailSignature As String
Dim CurrentMonth As String, DestFolder As String, PDFFile As String
Dim Email_To As String, Email_CC As String, Email_BCC As String
Dim OpenPDFAfterCreating As Boolean, AlwaysOverwritePDF As Boolean, DisplayEmail As Boolean
Dim OverwritePDF As VbMsgBoxResult
Dim OutlookApp As Object, OutlookMail As Object
Dim Recipients, f
CurrentMonth = ""
' *****************************************************
' ***** You Can Change These Variables *********
EmailSubject = "Dispatch Sheet " 'Change this to change the subject of the email. The current month is added to end of subj line
OpenPDFAfterCreating = False 'Change this if you want to open the PDF after creating it : TRUE = Yes or FALSE = No
AlwaysOverwritePDF = False 'Change this if you always want to overwrite a PDF that already exists :TRUE or FALSE
DisplayEmail = True 'Change this if you don't want to display the email before sending. True =Yes, False=No, Note,
'you must have a TO email address specified for this to work
Recipients = ActiveSheet.Range("R84:R86") 'Change this if you want to specify To email e.g. ActiveSheet.Range("H1") to get email from cell H1
For f = 1 To UBound(Recipients)
Email_To = Email_To & Recipients(f, 1) & "; "
Next f
Email_CC = "" 'Change this if you want to specify To email
Email_BCC = "" 'Change this if you want to specify To email