Alphacsulb
Active Member
- Joined
- Mar 20, 2008
- Messages
- 414
I came across this VBA post that allows me to create an email and BCC a list of emails, however I want to gather the visible filtered list, and not everything that is within the range.
I'm unsure where SpecialCells(xlCellTypeVisible) would apply. Any assistance would be appreciated:
I'm unsure where SpecialCells(xlCellTypeVisible) would apply. Any assistance would be appreciated:
Code:
Sub CreateEmail()
Dim oMSOutlook As Object
Dim oEmail As Object
Set oMSOutlook = CreateObject("Outlook.Application")
Set oEmail = oMSOutlook.CreateItem(olMailItem)
With oEmail
For i = 2 To Application.WorksheetFunction.CountA(Columns(4)) '2 Skips header, Column 4 applies to Column D
.Recipients.Add(Cells(i, 4).Value).Type (3) ' Type 1 (To), Type 2 (CC), Type 3 (BCC)
Next i
.Display 'Displays the email before it gets sent
End With
Set oMSOutlook = Nothing
Set oEmail = Nothing
End Sub