Hi All,
I'm attempting to make a quick macro that emails data found in column D of Sheet "Scorecard" with the last set of data. My current issue is that column D actually is full of a formula that has its data determined as a percentage based off of columns C and B, so it is unable to find the actual data I'm looking for.
The formula found in Column D is the following:
=IFERROR((C2-B2)/C2,"")
The issue is that this formula is implemented throughout all of column D but currently the only cell that has actual data is D2, which will then be D3 next week.
IE: Can I send data from column D based on the last row of data from Column C, as that column will be manually implemented, if this makes sense.
I'm attempting to make a quick macro that emails data found in column D of Sheet "Scorecard" with the last set of data. My current issue is that column D actually is full of a formula that has its data determined as a percentage based off of columns C and B, so it is unable to find the actual data I'm looking for.
VBA Code:
Sub Submit()
Application.DisplayAlerts = False
Dim path As String
Dim filename1 As String
Dim emailApplication As Object
Dim emailItem As Object
ChDrive "F"
ChDir "Filepath"
filename1 = "Filename"
ActiveWorkbook.SaveAs Filename:=path & filename1, FileFormat:=52
Set emailApplication = CreateObject("Outlook.Application")
Set emailItem = emailApplication.CreateItem(0)
emailItem.to = "DummyEmail@Email.com"
emailItem.Subject = "First Pass Yield this Week"
emailItem.Body = "First Pass Yield" & ThisWorkbook.Sheets("Scorecard").Range("D" & Rows.Count).End(xlUp).Value
emailItem.Attachments.Add ActiveWorkbook.FullName
emailItem.Send
Set emailItem = Nothing
Set emailApplication = Nothing
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.AutomationSecurity = msoAutomationSecurityForceDisable
Application.AskToUpdateLinks = False
Application.DisplayAlerts = True
ActiveWorkbook.Close True
End Sub
The formula found in Column D is the following:
=IFERROR((C2-B2)/C2,"")
The issue is that this formula is implemented throughout all of column D but currently the only cell that has actual data is D2, which will then be D3 next week.
IE: Can I send data from column D based on the last row of data from Column C, as that column will be manually implemented, if this makes sense.