I'm looking to have a button assigned to a macro which when pressed will send an email which references data in cells in the same row as the button.
I have the code for sending the email but at the minute only know how to link it directly to certain cells, e.g. A1, B1, C1.
Sub Email_From_Excel_Basic()
Dim emailApplication As Object
Dim emailItem As Object
Set emailApplication = CreateObject("Outlook.Application")
Set emailItem = emailApplication.CreateItem(0)
' Now we build the email.
emailItem.to = Range("A1")
emailItem.Subject = Range("B1")
emailItem.Body = Range("C1")
emailItem.Display
Set emailItem = Nothing
Set emailApplication = Nothing
End Sub
What I want to be able to do is click a button assigned to a row which will then run the macro using the cell references just from that row.
Any help will be appreciated.
Thanks