I am extremely new with VBA, and would be highly appreciative of help.
I have the script below working.
I would like to modify it a bit
ChDir "C:\file1\files\CURRENT YEAR\CURRENT MONTH\"
directory = "C:\file1\files\CURRENT YEAR\CURRENT MONTH\""
I want to have the CURRENT YEAR and MONTH populate automatically based on thir current days
I want to have the email sent to recipients based on a list on Sheet1 cells A1:A10
And I need to add body text to the email HTML prefeable, or txt maybe read from a txt file on my hard drive.
Any and all help is great.
Thanks!!!
Sub sendfile()
Sheets(ActiveSheet.Name).Copy
ChDir "C:\file1\files\CURRENT YEAR\CURRENT MONTH\"
directory = "C:\file1\files\CURRENT YEAR\CURRENT MONTH\""
filenamesave = "My File " & FormatDateTime(Date, vbLongDate)
ActiveWorkbook.SaveAs Filename:=directory & filenamesave & ".xls", FileFormat _
:=xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:= _
False, CreateBackup:=False
If MsgBox("Are you sure this file is ready to send?", vbOKCancel, _
"Are you sure...") = vbCancel Then Exit Sub
ActiveWorkbook.SendMail Recipients:="abc@abcd.com", Subject:=filenamesave
MsgBox "File Sent.", vbOKOnly
End Sub
I have the script below working.
I would like to modify it a bit
ChDir "C:\file1\files\CURRENT YEAR\CURRENT MONTH\"
directory = "C:\file1\files\CURRENT YEAR\CURRENT MONTH\""
I want to have the CURRENT YEAR and MONTH populate automatically based on thir current days
I want to have the email sent to recipients based on a list on Sheet1 cells A1:A10
And I need to add body text to the email HTML prefeable, or txt maybe read from a txt file on my hard drive.
Any and all help is great.
Thanks!!!
Sub sendfile()
Sheets(ActiveSheet.Name).Copy
ChDir "C:\file1\files\CURRENT YEAR\CURRENT MONTH\"
directory = "C:\file1\files\CURRENT YEAR\CURRENT MONTH\""
filenamesave = "My File " & FormatDateTime(Date, vbLongDate)
ActiveWorkbook.SaveAs Filename:=directory & filenamesave & ".xls", FileFormat _
:=xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:= _
False, CreateBackup:=False
If MsgBox("Are you sure this file is ready to send?", vbOKCancel, _
"Are you sure...") = vbCancel Then Exit Sub
ActiveWorkbook.SendMail Recipients:="abc@abcd.com", Subject:=filenamesave
MsgBox "File Sent.", vbOKOnly
End Sub