Thread: UDF using Dates
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Jim Dean Jim Dean is offline
external usenet poster
 
Posts: 7
Default UDF using Dates

Hi Bob see below cheers Jim

Function FreezeDate()

ActiveCell.Select


ActiveCell.FormulaR1C1 = "=NOW()"

'this macro places date then copies it to the same cell and changes the cell
to value.
'this allows the date to remain frozen


Selection.Copy

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.NumberFormat = "d/mm/yyyy;@"



End Function


"Bob Phillips" wrote:

Post the UDF.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Jim Dean" <Jim wrote in message
...
I have wriiten UDF including the =NOW() function in it. When checking
using
De-bug it places the result of the UDF in the workbook correctly. When
calling the UDF in the workbook it gives VALUE error. Only have this
problem
with Date Functions.
Anyone has a solution please Thanks Guys..Jim.