Bekijk de onderstaande video om te zien hoe je onze site als een web app op je startscherm installeert.
Opmerking: Deze functie is mogelijk niet beschikbaar in sommige browsers.
Function MailAdressen() As String
Dim sh As Worksheet
For Each sh In ThisWorkbook.Worksheets
If LCase(sh.Name) <> "medewerkers" Then
MailAdressen = MailAdressen & sh.Range("A1") & ";"
For Each cel In [=mailcode]
a = medewerkers.Cells(cel.Row, 9).Value
If cel.Value = "e" And a <> "" Then
emailadres = a: x = x + 1
Next sh
End If
Next
MailAdressen = Left(MailAdressen, Len(MailAdressen) - 1)
End If
End Function
Sub tst()
For i = 1 To 35
With Sheets("ORT" & i)
Fname = .Range("F10").Value & ".pdf"
eAddress = .Range("A1").Value
.ExportAsFixedFormat 0, ThisWorkbook.Path & "\" & Fname
End With
With CreateObject("Outlook.application").CreateItem(0)
.To = eAddress
.Subject = " ORT lijst van de afgelopen maand"
.Body = "Bijgaand het overzicht van de afgelopen maand" _
& vbNewLine & vbNewLine & "met vriendelijke groet,"
.Attachments.Add ThisWorkbook.Path & "\" & Fname
.Send
End With
Kill ThisWorkbook.Path & "\" & Fname
Next
End Sub
Sub tst()
sn = Sheets("medewerkers").Range("A10").CurrentRegion
For i = 2 To UBound(sn)
If sn(i, 1) = "e" Then tomail = tomail & sn(i, 2) & ";"
Next
For i = 1 To 35
If InStr(1, tomail, Sheets("ORT" & i).Range("F10").Value, vbTextCompare) Then
With Sheets("ORT" & i)
Fname = .Range("F10").Value & ".pdf"
eAddress = .Range("A1").Value
.ExportAsFixedFormat 0, ThisWorkbook.Path & "\" & Fname
End With
With CreateObject("Outlook.application").CreateItem(0)
.To = eAddress
.Subject = " ORT lijst van de afgelopen maand"
.Body = "Bijgaand het overzicht van de afgelopen maand" _
& vbNewLine & vbNewLine & "met vriendelijke groet,"
.Attachments.Add ThisWorkbook.Path & "\" & Fname
.Send
End With
Kill ThisWorkbook.Path & "\" & Fname
Else
Sheets("ORT" & i).Range("C10:N62").PrintPreview 'of .PrintOut
End If
Next
End Sub
msgbox Thisworkbook.Path
Msgbox Fname
We gebruiken essentiële cookies om deze site te laten werken, en optionele cookies om de ervaring te verbeteren.