我已经复制了VBA代码,用于从excel中选定的单元格发送状态更新邮件。 但现在我想更改代码以将今天的日期添加到代码中,因此在发送状态邮件时,它将在主题和介绍部分中选择今天的日期。以下是代码
Sub Send_Range()
ActiveSheet.Range("A1:B5").Select
ActiveWorkbook.EnvelopeVisible = True
With ActiveSheet.MailEnvelope
.Introduction = "This is a sample worksheet."
.Item.To = "E-Mail_Address_Here"
.Item.Subject = "My subject"
.Item.Send
End With
End Sub
请帮忙
答案 0 :(得分:4)
添加Date
功能:
.Item.Subject = "My subject " & Date