View Single Post
  #2   Report Post  
PeterAtherton
 
Posts: n/a
Default



"lost and confused" wrote:

I have to use excel to update inventory. I don't know what formula to use.
What I need to have is every time a record is added, a seperate column will
put a time stamp there. I tried useing the NOW() command, but all the
records changed when I added data in a row. Please help.


The following function will not recalculate unless you press ALT + F9

Function DateStamp() As Date
Static mydate
mydate = Int(Now)
DateStamp = mydate
End Function

Copy this into a VB Module (ALT + F11, Insert Module) in the workbook and
type =datestamp() into a cell.

Alternatively, enter the dates as text using this macro.

Sub test()
Dim c
For Each c In Selection
c.Value = Int(Now)
c.NumberFormat = "dd/mm/yy"
Next
End Sub

copy into a vb module as above select the range to enter the dates and run
the macro from Tools, Macro select test and click run.

If you are happy with this you can create a button or drawing object and
assign the macro to the button.

Regards
Peter