Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a user defined function which returns a date. I want to set the
caller cell's format to "Date" before placing my result. How can i do that? I tried with this code but i am getting a number...If i change the cell format into date manully, it works fine. Function ReturnDate() as date ReturnDate="2/11/2008" range(application.caller.address).numberformat="mm/dd/yyyy" End Function Inside sheet... =ReturnDate() where did i go wrong? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
A UDF cannot change a cell's format. Just set the format in the worksheet in
the usual way. -- Gary''s Student - gsnu2007d " wrote: I have a user defined function which returns a date. I want to set the caller cell's format to "Date" before placing my result. How can i do that? I tried with this code but i am getting a number...If i change the cell format into date manully, it works fine. Function ReturnDate() as date ReturnDate="2/11/2008" range(application.caller.address).numberformat="mm/dd/yyyy" End Function Inside sheet... =ReturnDate() where did i go wrong? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to change "xxx CR" and "y,yyy DB" to "+xxx" and "-yyyy" | Excel Worksheet Functions | |||
change "true" and "false" to "availble" and "out of stock" | Excel Worksheet Functions | |||
Excel VBA to convert "dd.MM.yy" text to "dd/MM/yyyy" format date? | Excel Programming | |||
Option Explicit and Date Format "dd mmm yyyy"? | Excel Programming | |||
How To: Use Cell("Format") to return MMMM YYYY instead of D3 | Excel Programming |