Hi guys, new to the forum and VBA coding. Already learnt heaps reading through the stickies and previous threads. Been searching for a similar already solved problem but can't find it exactly.
Have been trying to use RDB's coding for these but keep getting compile errors. Saw one of the experienced contributors put this forward for a different problem, is it possible to tweak the below coding to compile a pdf of cells B1:I56 and send to recipient in L4 on button activation using default email program?
Sub sendEmail()
Dim OutApp As Object
Dim OutMail As Object
Dim dataWs As Worksheet
On Error GoTo test_Error
'Change the following line to the sheet containing the data
Set dataWs = Worksheets("Sheet9")
For k = 2 To dataWs.Cells(Rows.Range "B1:I56").End(xlUp).Row
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = dataWs.Range("L4" & k)
.Subject = "Generic subject"
' In place of the following statement, you can use ".Send" to Send the email
'.Display
.Send
End With
End If
Set OutMail = Nothing
Set OutApp = Nothing
Next
On Error GoTo 0
Exit Sub
test_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure test of Module1"
End Sub
My main goal is to have the participant value as a listbox with all sections filled out in vlookup with a simple macro button to compile and send through the default mail with a standardised subject and filename.
Really need help with this, happy to contract someone to do the coding if they're interested.
Bookmarks