Gruppe
Extern
Problem
An die in Spalte B genannten Emailadressen sollen die Arbeitsmappen aus Spalte A mit dem Standardmailprogramm versandt werden.
StandardModule: Modul1
Sub SendWkbs()
Dim wks As Worksheet
Dim iRowA As Integer, iRowB As Integer
Application.ScreenUpdating = False
Set wks = ActiveSheet
iRowA = 2
Do Until IsEmpty(wks.Cells(iRowA, 1))
iRowB = 2
Do Until IsEmpty(wks.Cells(iRowB, 2))
Workbooks.Open wks.Cells(iRowA, 1).Value, False, True
ActiveWorkbook.SendMail wks.Cells(iRowB, 2).Value, Subject:="Test"
ActiveWorkbook.Close savechanges:=False
iRowB = iRowB + 1
Loop
iRowA = iRowA + 1
Loop
Application.ScreenUpdating = True
End Sub