Dear all . I hope you can help me with the following problem :
Have created 2 timestamp functions with VBA , one for the date and one for the time in order to use them when a specific value is changed in a specific cell . For example when data is changed at cell C then cells A & B are automatically updated with the date and time respectvilly . Everything works and looks ok but when i am sending the file to another person, (as xlsm file) , when the other person opens file the timestamp cells are being changed to the date and time the person opened the file . Have tried to overcome the issue by locking the cells but in vain.
At first i thought that it is happening because the other person has the marco security enabled and when they disable it in order to open the file it resets the function (maybe it plays some role) but even though it does nt make sense as is cancelling the meaning of the timestamp itself.
Below the 2 functions :
1]
Function TimestampFORDATE(Reference As Range)
If Reference.Value <> "" Then
TimestampFORDATE = Format(VBA.DateTime.Now, "dd-mm-YYYY")
Else
TimestampFORDATE = ""
End If
End Function
2]
Function TimestampFORTIME(Reference As Range)
If Reference.Value <> "" Then
TimestampFORTIME = Format(VBA.DateTime.Now, "HH:MM")
Else
TimestampFORTIME = ""
End If
End Function
Have created 2 timestamp functions with VBA , one for the date and one for the time in order to use them when a specific value is changed in a specific cell . For example when data is changed at cell C then cells A & B are automatically updated with the date and time respectvilly . Everything works and looks ok but when i am sending the file to another person, (as xlsm file) , when the other person opens file the timestamp cells are being changed to the date and time the person opened the file . Have tried to overcome the issue by locking the cells but in vain.
At first i thought that it is happening because the other person has the marco security enabled and when they disable it in order to open the file it resets the function (maybe it plays some role) but even though it does nt make sense as is cancelling the meaning of the timestamp itself.
Below the 2 functions :
1]
Function TimestampFORDATE(Reference As Range)
If Reference.Value <> "" Then
TimestampFORDATE = Format(VBA.DateTime.Now, "dd-mm-YYYY")
Else
TimestampFORDATE = ""
End If
End Function
2]
Function TimestampFORTIME(Reference As Range)
If Reference.Value <> "" Then
TimestampFORTIME = Format(VBA.DateTime.Now, "HH:MM")
Else
TimestampFORTIME = ""
End If
End Function
ΒΙΚΤΩΡΙΑ ΦΟΡΜΑ .xlsm | |||
---|---|---|---|
B | |||
13 | 30-01-2021 | ||
ΜΗΝΑΣ |
Cell Formulas | ||
---|---|---|
Range | Formula | |
B13 | B13 | =TimestampFORDATE(D13) |
Cells with Conditional Formatting | ||||
---|---|---|---|---|
Cell | Condition | Cell Format | Stop If True | |
A13:O102 | Expression | =$D13="ΑΛΛΑΓΗ ΠΡΟΓΡΑΜΜΑΤΟΣ" | text | NO |
A13:O102 | Expression | =$D13="ΑΛΛΑΓΗ ΣΤΟΙΧΕΙΩΝ" | text | NO |
A13:O102 | Expression | =$D13="ΔΙΑΦΟΡΑ" | text | NO |
A13:O102 | Expression | =$D13="RETENTION" | text | NO |
A13:O102 | Expression | =$D13="ΠΑΡΑΠΟΝΟ" | text | NO |
A13:O102 | Expression | =$D13="ΕΝΗΜΕΡΩΣΗ" | text | NO |
A13:O102 | Expression | =$D13="ΠΛΗΡΩΜΗ ΗΡΩΝ" | text | NO |
A13:O102 | Expression | =$D13="ΣΥΜΒΑΣΗ" | text | NO |
A13:O102 | Expression | =$D13="ΠΛΗΡΩΜΗ ΑΛΛΩΝ" | text | NO |