mass email i keep getting errors can some1 HELP ?? ? ? CLICK HERE !!

eric86vabeach

New Member
Joined
Jan 29, 2014
Messages
23
i keep getting an error can some1 look at this and help me fix this code?

or help me with the notes in this code







Sub sendemail(what_address As String, subject_line As String, mail_body As String)





Dim olapp As Outlook.Application
Set olapp = CreateObject("outlook.application")


Dim olMail As Outlook.MailItem
setolmail = olapp.CreateItem(olMailItem)

olMail.To = what_address
olMail.Sub = subject_line
olMail.Body = mail_body
olMail.Send





End Sub


Sub sendmassemail()
row_number = 2




Do
DoEvents
row_numbers = row_number + 1
Call sendemail(Sheet4.Range("BD" & row_number), "this is a test email", Sheet5.Range("BV2")) 'please read note at bottom about this line

Loop Until row_number = 6





End Sub

i would like cell "BQ1" type in the a cell # and it would say to the code grab the email from that cell and i think it would go where "this is a test email" goes?




thanks for your time and reading this
Eric
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Perhaps something like this
Code:
Sub sendmassemail()
     row_number = Range("BQ1").Value
     Do
         DoEvents
         row_numbers = row_number + 1
         Call sendemail(Sheet4.Range("BD" & row_number), "this is a test email", Sheet5.Range("BV2")) 'please read note at bottom about this line

    Loop Until row_number >= 6
End Sub
 
Upvote 0
Perhaps something like this
Code:
Sub sendmassemail()
     row_number = Range("BQ1").Value
     Do
         DoEvents
         row_numbers = row_number + 1
         Call sendemail(Sheet4.Range("BD" & row_number), "this is a test email", Sheet5.Range("BV2")) 'please read note at bottom about this line

    Loop Until row_number >= 6
End Sub


now i have error

Call sendemail(Sheet5.Range("BD" & row_number), "this is a test email", Sheet5.Range("$BV$2")) 'please read note at bottom about this line

object_work sheet failed
 
Upvote 0
What is in BQ1?
Does that refer to an email address or the text of the message?
Where do you want the email sent? To the addresses in BD2 thru BD6 as in the OP code?

What is that "note at the bottom" that you want read?
 
Upvote 0

Forum statistics

Threads
1,223,244
Messages
6,170,976
Members
452,372
Latest member
Natalie18

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