Sub emailstest() Dim i As Long Sheets("list").Select For i = 2 To Range("a65356").End(xlUp).Row Call send_emails(Range("a" & i).Text, Range("b" & i).Text, Range("c" & i).Text, Range("d" & i)) Next End Sub
Sub send_emails(nm As String, to1 As String, cc1 As String, rng As Range) Dim olApp As Outlook.Application Dim olMail As MailItem Dim fld As Object, fil As Object Dim attach1 As String, bl1 As Boolean Set fso = CreateObject("scripting.filesystemobject") Set fld = fso.getfolder("C:\Documents and Settings\user\Desktop\test & delete\my data") attach1 = "" b1 = False For Each fil In fld.Files If UCase(Left(fil.Name, Application.WorksheetFunction.Find(".", fil.Name) - 1)) = UCase(nm) Then attach1 = fil.Path bl1 = True Exit For End If Next fil If bl1 = False Then rng.Value = "File Not Found - No Mail Sent" Else Set olApp = New Outlook.Application Set olMail = olApp.CreateItem(olMailItem) With olMail .To = to1 .CC = cc1 .Subject = "Hello" .Body = "Please find the attachment" .Attachments.Add attach1 .Send End With Set olMail = Nothing Set olApp = Nothing rng.Value = attach1 End If End Sub On Sun, Dec 2, 2012 at 11:12 AM, Satendra kumar <satendrakuma...@gmail.com>wrote: > Dear sir, > > i want same mail send in email Cc address. > > > > On Sun, Dec 2, 2012 at 10:59 AM, ashish koul <koul.ash...@gmail.com>wrote: > >> whts in cc email >> >> On Sun, Dec 2, 2012 at 10:55 AM, Satendra kumar < >> satendrakuma...@gmail.com> wrote: >> >>> Thank you so much sir, >>> >>> but cc email is pick up........ >>> >>> thankx >>> satendra >>> >>> >>> On Sun, Dec 2, 2012 at 10:46 AM, ashish koul <koul.ash...@gmail.com>wrote: >>> >>>> >>>> Hi >>>> >>>> Try the attached file >>>> >>>> - change the folder path in code. >>>> >>>> >>>> Regards, >>>> Ashish Koul >>>> >>>> On Fri, Nov 30, 2012 at 10:15 AM, Satendra kumar < >>>> satendrakuma...@gmail.com> wrote: >>>> >>>>> Dear Sir, >>>>> >>>>> I am not expert in vba, i am beginner vba so please me suggest me >>>>> where is add loop?? >>>>> >>>>> >>>>> thankx >>>>> satendra >>>>> >>>>> >>>>> >>>>> >>>>> On Thu, Nov 29, 2012 at 8:22 PM, ashish koul <koul.ash...@gmail.com>wrote: >>>>> >>>>>> >>>>>> @ Narton - Thanks >>>>>> >>>>>> @Satendra kumar - whts nt wrkng in the file u need to add the loop >>>>>> >>>>>> On Thu, Nov 29, 2012 at 6:52 AM, Natron <protoc...@gmail.com> wrote: >>>>>> >>>>>>> *Ashish, you are awesome!* >>>>>>>> >>>>>>> -- >>>>>>> Join official Facebook page of this forum @ >>>>>>> https://www.facebook.com/discussexcel >>>>>>> >>>>>>> FORUM RULES >>>>>>> >>>>>>> 1) Use concise, accurate thread titles. Poor thread titles, like >>>>>>> Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need >>>>>>> Advice will not get quick attention or may not be answered. >>>>>>> 2) Don't post a question in the thread of another member. >>>>>>> 3) Don't post questions regarding breaking or bypassing any security >>>>>>> measure. >>>>>>> 4) Acknowledge the responses you receive, good or bad. >>>>>>> 5) Jobs posting is not allowed. >>>>>>> 6) Sharing copyrighted material and their links is not allowed. >>>>>>> >>>>>>> NOTE : Don't ever post confidential data in a workbook. Forum owners >>>>>>> and members are not responsible for any loss. >>>>>>> --- >>>>>>> You received this message because you are subscribed to the Google >>>>>>> Groups "MS EXCEL AND VBA MACROS" group. >>>>>>> To post to this group, send email to excel-macros@googlegroups.com. >>>>>>> To unsubscribe from this group, send email to >>>>>>> excel-macros+unsubscr...@googlegroups.com. >>>>>>> Visit this group at >>>>>>> http://groups.google.com/group/excel-macros?hl=en. >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> *Regards* >>>>>> * * >>>>>> *Ashish Koul* >>>>>> >>>>>> >>>>>> *Visit* >>>>>> *http://www.excelvbamacros.com/* >>>>>> *http://www.accessvbamacros.com/* >>>>>> >>>>>> P Before printing, think about the environment. >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Join official Facebook page of this forum @ >>>>>> https://www.facebook.com/discussexcel >>>>>> >>>>>> FORUM RULES >>>>>> >>>>>> 1) Use concise, accurate thread titles. Poor thread titles, like >>>>>> Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need >>>>>> Advice will not get quick attention or may not be answered. >>>>>> 2) Don't post a question in the thread of another member. >>>>>> 3) Don't post questions regarding breaking or bypassing any security >>>>>> measure. >>>>>> 4) Acknowledge the responses you receive, good or bad. >>>>>> 5) Jobs posting is not allowed. >>>>>> 6) Sharing copyrighted material and their links is not allowed. >>>>>> >>>>>> NOTE : Don't ever post confidential data in a workbook. Forum owners >>>>>> and members are not responsible for any loss. >>>>>> --- >>>>>> You received this message because you are subscribed to the Google >>>>>> Groups "MS EXCEL AND VBA MACROS" group. >>>>>> To post to this group, send email to excel-macros@googlegroups.com. >>>>>> To unsubscribe from this group, send email to >>>>>> excel-macros+unsubscr...@googlegroups.com. >>>>>> Visit this group at http://groups.google.com/group/excel-macros?hl=en >>>>>> . >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Thanks & Regards >>>>> Satendra Kumar >>>>> >>>>> -- >>>>> Join official Facebook page of this forum @ >>>>> https://www.facebook.com/discussexcel >>>>> >>>>> FORUM RULES >>>>> >>>>> 1) Use concise, accurate thread titles. Poor thread titles, like >>>>> Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need >>>>> Advice will not get quick attention or may not be answered. >>>>> 2) Don't post a question in the thread of another member. >>>>> 3) Don't post questions regarding breaking or bypassing any security >>>>> measure. >>>>> 4) Acknowledge the responses you receive, good or bad. >>>>> 5) Jobs posting is not allowed. >>>>> 6) Sharing copyrighted material and their links is not allowed. >>>>> >>>>> NOTE : Don't ever post confidential data in a workbook. Forum owners >>>>> and members are not responsible for any loss. >>>>> --- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "MS EXCEL AND VBA MACROS" group. >>>>> To post to this group, send email to excel-macros@googlegroups.com. >>>>> To unsubscribe from this group, send email to >>>>> excel-macros+unsubscr...@googlegroups.com. >>>>> Visit this group at http://groups.google.com/group/excel-macros?hl=en. >>>>> >>>>> >>>>> >>>> >>>> >>>> >>>> -- >>>> *Regards* >>>> * * >>>> *Ashish Koul* >>>> >>>> >>>> *Visit* >>>> *http://www.excelvbamacros.com/* >>>> *http://www.accessvbamacros.com/* >>>> >>>> P Before printing, think about the environment. >>>> >>>> >>>> >>>> -- >>>> Join official Facebook page of this forum @ >>>> https://www.facebook.com/discussexcel >>>> >>>> FORUM RULES >>>> >>>> 1) Use concise, accurate thread titles. Poor thread titles, like Please >>>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice >>>> will not get quick attention or may not be answered. >>>> 2) Don't post a question in the thread of another member. >>>> 3) Don't post questions regarding breaking or bypassing any security >>>> measure. >>>> 4) Acknowledge the responses you receive, good or bad. >>>> 5) Jobs posting is not allowed. >>>> 6) Sharing copyrighted material and their links is not allowed. >>>> >>>> NOTE : Don't ever post confidential data in a workbook. Forum owners >>>> and members are not responsible for any loss. >>>> --- >>>> You received this message because you are subscribed to the Google >>>> Groups "MS EXCEL AND VBA MACROS" group. >>>> To post to this group, send email to excel-macros@googlegroups.com. >>>> To unsubscribe from this group, send email to >>>> excel-macros+unsubscr...@googlegroups.com. >>>> Visit this group at http://groups.google.com/group/excel-macros?hl=en. >>>> >>>> >>>> >>> >>> >>> >>> -- >>> Thanks & Regards >>> Satendra Kumar >>> >>> -- >>> Join official Facebook page of this forum @ >>> https://www.facebook.com/discussexcel >>> >>> FORUM RULES >>> >>> 1) Use concise, accurate thread titles. Poor thread titles, like Please >>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice >>> will not get quick attention or may not be answered. >>> 2) Don't post a question in the thread of another member. >>> 3) Don't post questions regarding breaking or bypassing any security >>> measure. >>> 4) Acknowledge the responses you receive, good or bad. >>> 5) Jobs posting is not allowed. >>> 6) Sharing copyrighted material and their links is not allowed. >>> >>> NOTE : Don't ever post confidential data in a workbook. Forum owners and >>> members are not responsible for any loss. >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "MS EXCEL AND VBA MACROS" group. >>> To post to this group, send email to excel-macros@googlegroups.com. >>> To unsubscribe from this group, send email to >>> excel-macros+unsubscr...@googlegroups.com. >>> Visit this group at http://groups.google.com/group/excel-macros?hl=en. >>> >>> >>> >> >> >> >> -- >> *Regards* >> * * >> *Ashish Koul* >> >> >> *Visit* >> *http://www.excelvbamacros.com/* >> *http://www.accessvbamacros.com/* >> >> P Before printing, think about the environment. >> >> >> >> -- >> Join official Facebook page of this forum @ >> https://www.facebook.com/discussexcel >> >> FORUM RULES >> >> 1) Use concise, accurate thread titles. Poor thread titles, like Please >> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice >> will not get quick attention or may not be answered. >> 2) Don't post a question in the thread of another member. >> 3) Don't post questions regarding breaking or bypassing any security >> measure. >> 4) Acknowledge the responses you receive, good or bad. >> 5) Jobs posting is not allowed. >> 6) Sharing copyrighted material and their links is not allowed. >> >> NOTE : Don't ever post confidential data in a workbook. Forum owners and >> members are not responsible for any loss. >> --- >> You received this message because you are subscribed to the Google Groups >> "MS EXCEL AND VBA MACROS" group. >> To post to this group, send email to excel-macros@googlegroups.com. >> To unsubscribe from this group, send email to >> excel-macros+unsubscr...@googlegroups.com. >> Visit this group at http://groups.google.com/group/excel-macros?hl=en. >> >> >> > > > > -- > Thanks & Regards > Satendra Kumar > > -- > Join official Facebook page of this forum @ > https://www.facebook.com/discussexcel > > FORUM RULES > > 1) Use concise, accurate thread titles. Poor thread titles, like Please > Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice > will not get quick attention or may not be answered. > 2) Don't post a question in the thread of another member. > 3) Don't post questions regarding breaking or bypassing any security > measure. > 4) Acknowledge the responses you receive, good or bad. > 5) Jobs posting is not allowed. > 6) Sharing copyrighted material and their links is not allowed. > > NOTE : Don't ever post confidential data in a workbook. Forum owners and > members are not responsible for any loss. > --- > You received this message because you are subscribed to the Google Groups > "MS EXCEL AND VBA MACROS" group. > To post to this group, send email to excel-macros@googlegroups.com. > To unsubscribe from this group, send email to > excel-macros+unsubscr...@googlegroups.com. > Visit this group at http://groups.google.com/group/excel-macros?hl=en. > > > -- *Regards* * * *Ashish Koul* *Visit* *http://www.excelvbamacros.com/* *http://www.accessvbamacros.com/* P Before printing, think about the environment. -- Join official Facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Jobs posting is not allowed. 6) Sharing copyrighted material and their links is not allowed. NOTE : Don't ever post confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To post to this group, send email to excel-macros@googlegroups.com. To unsubscribe from this group, send email to excel-macros+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/excel-macros?hl=en.