Hi,
Hope everyone is well.
How do i edit the below code that automatically sends an email the the specified address, i need to change it so that it allows me to write a message in the message body of the e-mail and then i will click send on the email manually?
Sub Mail_Range()
Application.Run "'Recall_Tracker-MPS.xlsm'!Unprotect"
Dim Source As Range
Dim Dest As Workbook
Dim wb As Workbook
Dim TempFilePath As String
Dim TempFileName As String
Dim FileExtStr As String
Dim FileFormatNum As Long
'insertion
CurCol = Selection.Interior.ColorIndex
Selection.Interior.ColorIndex = 6
'end of insertion
Set Source = Nothing
On Error Resume Next
Set Source = Range("A1:U36").SpecialCells(xlCellTypeVisible)
On Error GoTo 0
If Source Is Nothing Then
MsgBox "The source is not a range or the sheet is protected, " & _
"please correct and try again.", vbOKOnly
Exit Sub
End If
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
Set wb = ActiveWorkbook
Set Dest = Workbooks.Add(xlWBATWorksheet)
Source.Copy
With Dest.Sheets(1)
.Cells(1).PasteSpecial Paste:=8
.Cells(1).PasteSpecial Paste:=xlPasteValues
.Cells(1).PasteSpecial Paste:=xlPasteFormats
.Cells(1).Select
Application.CutCopyMode = False
End With
'insertion
wb.Activate
Selection.Interior.ColorIndex = CurCol
'end of insertion
TempFilePath = Environ$("temp") & "\"
TempFileName = "Selection of " & wb.Name & " " _
& Format(Now, "dd-mmm-yy h-mm-ss")
If Val(Application.Version) < 12 Then
'You use Excel 2000-2003
FileExtStr = ".xls": FileFormatNum = -4143
Else
'You use Excel 2007
FileExtStr = ".xlsx": FileFormatNum = 51
End If
With Dest
.SaveAs TempFilePath & TempFileName & FileExtStr, _
FileFormat:=FileFormatNum
On Error Resume Next
.SendMail "email address here", _
"subject line here"
On Error GoTo 0
.Close SaveChanges:=False
End With
Kill TempFilePath & TempFileName & FileExtStr
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
' colourchange Macro
'
'
Range( _
"B6:G22,G23:I23,L23:N23,Q23:S23,P6:Q22,K6:L22,E27:F29,E31:F31,E33:F33,C27:C28") _
.Select
Range("C27").Activate
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorLight2
.TintAndShade = 0.599993896298105
.PatternTintAndShade = 0
End With
Range("H6:J22,M6:O22,R6:T22,C26").Select
Range("C26").Activate
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent5
.TintAndShade = 0.599993896298105
.PatternTintAndShade = 0
End With
Application.Run "'Recall_Tracker-MPS.xlsm'!Protect"
Range("B2:D2").Select
End Sub
Basically i would like it to do all of the above but stop right at the point of sending so that i can write a message and then click send?
Regards,
Jamie
Bookmarks