hello everyone i have created a vba code to send email via outlook now i have to do one thing it is to read the first row and next and next , for example in A2 ,A3....... so on there are list of email recipient to be added to the field (TO of Outlook) and B2,B3... C1,C2.... so on there are text to be added to the field (BODY of the outlook) . so i need to program like read first row then extract data from A2 and pass it TO OF OUTLOOK and then Extract from B2,C2 and pass to BODY OF OUTLOOK then move to next row like A3,B3,C3 then A4,B4,C4 ....... and so on any idea how can program this. I guess i need to create a for loop but i don't know exactly how to make it .Below i have given my program please help me out
Private Sub CommandButton1_Click()
Dim Rng As Range, c As Range
Dim OutlookApp As Object
Dim OutlookMail As Object
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookMail = OutlookApp.CreateItem(0)
On Error Resume Next
With OutlookMail
.To = Range("A2")
.CC = ""
.BCC = ""
.Subject = "test"
.Body = Range"B2")
.Display
End With
Set OutlookMail = Nothing
Set OutlookApp = Nothing
End Sub
Private Sub CommandButton1_Click()
Dim Rng As Range, c As Range
Dim OutlookApp As Object
Dim OutlookMail As Object
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookMail = OutlookApp.CreateItem(0)
On Error Resume Next
With OutlookMail
.To = Range("A2")
.CC = ""
.BCC = ""
.Subject = "test"
.Body = Range"B2")
.Display
End With
Set OutlookMail = Nothing
Set OutlookApp = Nothing
End Sub