Hello Everyone,
I am trying to build a issue tracker template for our IT team. One of the features in this template is, once a user enters a line item, the most recent line item should be e-mailed to the IT team. I am using the code shown below for this purpose
I would like to keep the selection range (columns B thru H and the most recently entered row) dynamic. For this, I am using a variable for the most recently entered row number (which I have stored in cell A2 on the active sheet). However, I cannot get the macro to select the most recent range.
I would appreciate any help you can offer.
Thanks,
Sub EMailIssue()
Dim Maxrow As Integer
Dim Sendrng As Range
If MsgBox("Do you want to send the Email ?", vbOKCancel, _
"Email Confirmation") = vbCancel Then Exit Sub
Maxrow = Worksheets("Issue Tracker Log").Range("A2")
Set Sendrng = Worksheets("Issue Tracker Log").Range("B" & Maxrow).Offset (0 , 5)
With Sendrng
.Parent.Select
.Select
ActiveWorkbook.EnvelopeVisible = True
With .Parent.MailEnvelope
.Introduction = "Test mail."
With .Item
.To = Worksheets("DDs").Range("N5")
.CC = Worksheets("DDs").Range("N6")
.Subject = "Test subject"
.Send
End With
End With
End With
End Sub
Bookmarks