Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jim,
You can't do things like that with UDFs. They return a value into the cell, they cannot change the cell value as you are trying to do, that would overwrite the function that is running. Why not just use =TEXT(TODAY(),"d/mm/yyyy;@") in the cell? -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Jim Dean" wrote in message ... 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. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Bob
Give me the name of your boss and I tell him to pay you double. Great work Pal and thanks, it works like magic Keep well Cheers from sunny Sydney. "Bob Phillips" wrote: Jim, You can't do things like that with UDFs. They return a value into the cell, they cannot change the cell value as you are trying to do, that would overwrite the function that is running. Why not just use =TEXT(TODAY(),"d/mm/yyyy;@") in the cell? -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Jim Dean" wrote in message ... 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. |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This doesn't keep the date frozen, though.
Is there a reason, you just don't hit ctrl-; and format the cell the way you like? Jim Dean wrote: Hi Bob Give me the name of your boss and I tell him to pay you double. Great work Pal and thanks, it works like magic Keep well Cheers from sunny Sydney. "Bob Phillips" wrote: Jim, You can't do things like that with UDFs. They return a value into the cell, they cannot change the cell value as you are trying to do, that would overwrite the function that is running. Why not just use =TEXT(TODAY(),"d/mm/yyyy;@") in the cell? -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Jim Dean" wrote in message ... 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. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Linking computer dates (time) to spreadsheet dates that have formu | Excel Worksheet Functions | |||
compare 2 tables of dates to find the preceding dates | Excel Worksheet Functions | |||
Toggle a range of Julian dates to Gregorian Dates and Back | Excel Programming | |||
Identifying unique dates in a range of cells containing dates... | Excel Discussion (Misc queries) | |||
Calculating number of days between two dates that fall between two other dates | Excel Discussion (Misc queries) |