Hello, I currently have the following code:
This finds the last populated cell in column C and outputs an email to an individual showing them what the data is on that row for column D. At the moment, it is emailing as an integer and I would like it to be sent as a percentage such as 0.00%.
IE: the emailitem.Body is sent as Text 1 for 100% when instead it should be sent as Text 100%.
Likewise, if it is 98% it is currently being sent as Text .98 instead of Text 98%.
VBA Code:
Sub Submit()
Application.DisplayAlerts = False
Dim path As String
Dim filename1 As String
Dim emailApplication As Object
Dim emailItem As Object
Dim lastRow As Long
Dim mainWB As Workbook
Dim wsDest As Worksheet
Dim wsCopy As Worksheet
Set mainWB = ActiveWorkbook
Set wsCopy = mainWB.Worksheets("Sheet1")
lastRow = Cells(Rows.Count, 3).End(xlUp).Row
ChDrive "F"
ChDir "Path1"
filename1 = "name"
ActiveWorkbook.SaveAs Filename:=path & filename1, FileFormat:=52
Set emailApplication = CreateObject("Outlook.Application")
Set emailItem = emailApplication.CreateItem(0)
emailItem.to = "email@email.com"
emailItem.Subject = "subject"
emailItem.Body = "Text " & wsCopy.Range("D" & lastRow).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
This finds the last populated cell in column C and outputs an email to an individual showing them what the data is on that row for column D. At the moment, it is emailing as an integer and I would like it to be sent as a percentage such as 0.00%.
IE: the emailitem.Body is sent as Text 1 for 100% when instead it should be sent as Text 100%.
Likewise, if it is 98% it is currently being sent as Text .98 instead of Text 98%.