Date Stamp & Mailto

hmltnangel

Active Member
Joined
Aug 25, 2010
Messages
288
Office Version
  1. 365
Platform
  1. Windows
Hi folks,

Got two seemingly simple queries that I cant figure out myself.

First is to put a simple date stamp in a cell so I know when another cell was filled in. I have put the following formula in it but I know its wrong and Im not sure how to make it work correctly....

=IF(C5<>"",IF(J2="",NOW(),J2),"")

Basically I want J2 to record the date that C5 was completed.

:)

Second up I have a 'mailto' setup so that when a button is clicked it mails the workbook to someone. Is it possible to have it copy a particular cell and use the contents of that cell as the subject for the email?

thanks

D
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
With your Sheet looking like this:
Excel Workbook
ABCDEFGHIJ
1Mail to: >>>>>jmay@cox.netCell C5 last modified on:
2Subject Line: >>>Your Daily Report11/10/2011
3
4
512
6
7
Sheet1
Excel 2007

In the Same Sheets Code window paste in:

Rich (BB code):
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address<> "$C$5" Then Exit Sub
Application.EnableEvents = False
Range("J2").Value = Date
Application.EnableEvents = True
End Sub

Create a Forms Command Button on your sheet (Button1) -- the Event code will be created in a Standard Module. Inside the Wrapper Sub Button1_Click post in the below code to where it llooks like so:

Rich (BB code):
Sub Button1_Click()
ActiveWorkbook.SaveCopyAs Filename:="C:\Users\James\Documents\ExcelChest\MyDaily\MyDaily-" & Format(Date, "mm-dd-yyyy") & ".xlsm"
ActiveWorkbook.SendMail Recipients:=Range("G1"), Subject:=Range("G2")
End Sub

CAUTION -- CHANGE ABOVE RED LETTERING TO YOUR SETUPS BEFORE RUNNING...
 
Upvote 0
Well .... it did work, and now its stopped working..... any ideas why?

Does it make any difference if I protect the worksheet?

D
 
Upvote 0
Are you getting a Run-time error - where code is halting and the Debug Option is showing up?
 
Upvote 0

Forum statistics

Threads
1,203,073
Messages
6,053,379
Members
444,660
Latest member
Mingalsbe

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top