Mail sturen naar cel waarde

Status
Niet open voor verdere reacties.

jo geuens

Gebruiker
Lid geworden
13 feb 2010
Berichten
190
hallo ik had graag een mail gestuurd naar meerdere personen vanuit excel nu lukt dit al wel maar niet aan de hand van bep Cel waarde in Rij R en Rij S
ik heb al geprobeerd maar lukt mij nog niet.

Code:
Private Sub Mail_Click()

     Dim OutApp As Object
    Dim OutMail As Object
    Dim cell As Range

   

    Application.ScreenUpdating = False
    Set OutApp = CreateObject("Outlook.Application")

    On Error GoTo cleanup
    For Each cell In Columns("C").Cells.SpecialCells(xlCellTypeConstants)
        If cell.Value Like "?*@?*.?*" And _
           LCase(Cells(cell.Row, "D").Value) = "ja" _
           And LCase(Cells(cell.Row, "P").Text) = "100%" _
           And LCase(Cells(cell.Row, "E").Value) <> "Inged." Then

            Set OutMail = OutApp.CreateItem(0)

            On Error Resume Next
            With OutMail
                .To = cell.Value  ' [COLOR="#00FF00"]deze waarde is mail adress inrij B en dit werkt [/COLOR]
                .Cc = "jo.xxx@hotmail.com; Bart.xxxx@hotmail.com" '[COLOR="#FF0000"]geprobeerd[/COLOR] 'cell.Value '("R" & nr.Row) & cell.Value("S" & nr.Row) of  Cells(cell.Row, "R").Value_ & Cells(cell.Row, "S").Value_ ' "
                .Subject = "Werkaanvraag: " & Cells(cell.Row, "F").Value
                .Body = "Beste, " & Cells(cell.Row, "B").Value _
                & vbNewLine & vbNewLine & _
                    "  NR: " & Cells(cell.Row, "A").Value _
                & vbNewLine & _
                        "Uw werkaanvraag: " & Cells(cell.Row, "F").Value & " is uitgevoerd. " _
                & vbNewLine & _
                    "  " & "Omschrijving: " & Cells(cell.Row, "G").Value _
                & vbNewLine & _
                     "  " & "Opmerking: " & Cells(cell.Row, "H").Value _
                & vbNewLine & _
                     "  " & "Opmerking logistieker: " & Cells(cell.Row, "Q").Value _
                & vbNewLine & vbNewLine & _
                        "Groeten, Logistic Service."
                .Send
            End With
            On Error GoTo 0
            Cells(cell.Row, "E").Value = "Ready"
            Cells(cell.Row, "D").Value = "OK"
            Set OutMail = Nothing
        End If
    Next cell
 
Zonder voorbeeld blijven er wel een aantal vragen over.

Staat er in R én S een adres?
Is het juiste blad actief?
Dan zou het volgende moeten werken
Code:
.Cc = "jo.xxx@hotmail.com; Bart.xxxx@hotmail.com; " & cells(cell.row, "R")  & "; " & cells(cell.row, "S")
Als het óf R is of S, laat dan de tussen puntkomma weg.
Als je niet zeker bent van het actieve blad benoem dit dan
bv blad1.cells(cell.row, 18))

Mvg Leo
 
Laatst bewerkt:
mail sturen met celwaarde

Hoi Leo

Thankx man werkt perfect :thumb:

Groet Jo
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan