Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default UDF not available

Your function worked for me

==rmin(Sheet3!C5)

in a cell on Sheet2

I had to fix it so there is a space between the date and time or is returned
#Value

However, your mm:ss format doesn't return a correct time.

? format(0.445833333333333,"mm:ss")
12:00

where the actual time value is:
? format(0.445833333333333,"hh:mm:ss")
10:42:00

Since you are returning a date, you have to format the cell with the formula
to display as a date. Otherwise you would want to return a string, but you
wouldn't be able to treat it as a date in your worksheet.

--
Regards,
Tom Ogilvy




"Terry V" wrote in message
...
Stephen:
The workbook is open, it is a public function, no it does not compile in

the
immediate window (it says "Sub or Function not defined" --- not sure why

it
says this).

This is the code, very short. It is simply meant to format a cells

content
to "mm:ss" based on a date (always the current day) put into a cell

Public Function rmin(rnge As Range) As Date
'Dim rnge As Range
rmin = Date & Format(rnge, "mm:ss")
End Function

Takes the date (always the current day) from the given cell (rnge) and
displays only the minutes:seconds

In the immediate window, Im typing:
rmin("A3") ' A3 does contain a date.

Thank you so much
Terry

"Stephen Rasey" wrote in message
...
Is it a Function and not a Sub? It is not a Private Function is it?

Do you know that it compiles? Can you execute a test Sub that calls

the
function in VBA?

Is the workbook that it is in open?

Stephen Rasey
Houston
http://excelsig.org

"Terry V" wrote in message
...
Hello
I have created a function and for some reason, on my worksheets, the
function does not show up.

should it not show up in the User Defined functions in the "paste

function"
? (XL 2K)

Thank you
Terry








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"