ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Having input the current date in a cell I want to lock it (https://www.excelbanter.com/excel-programming/308161-re-having-input-current-date-cell-i-want-lock.html)

Dave Peterson[_3_]

Having input the current date in a cell I want to lock it
 
Maybe you could provide a macro to open Data|form and then when it closes, your
macro can do whatever you want.

Option Explicit
Sub testme01()
With ActiveSheet
.ShowDataForm
With .Cells(.Rows.Count, "Z").End(xlUp).Offset(1, 0)
.Value = Now
.NumberFormat = "mm/dd/yyyy hh:mm:ss"
End With
End With
End Sub


If you make it easy to run the macro (add a button from the forms toolbar and
assign the macro to this button), it might even work.

Jim Mc wrote:

I am running a macro to check info inputted by the form command. I want to
add the date and time at the moment the form is closed. I can do this but the
date and time changes as time moves on. How can I lock this data?


--

Dave Peterson


JE McGimpsey

Having input the current date in a cell I want to lock it
 
Very nice, Dave.

In article , Dave Peterson
wrote:

Maybe you could provide a macro to open Data|form and then when it closes,
your
macro can do whatever you want.



All times are GMT +1. The time now is 09:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com