Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Help with Formatting a cell holding a custom worksheet function

  Asked By: Abelerd    Date: Jan 24    Category: MS Office    Views: 752
  

I have a custom function that is displaying items from a collection in
a cell in excel. The items in the collection repesent time records
created using the TIME VBA Function. I am using:

Function GetItem(i as integer)

body

End Function

To present the items in the collection in excel.

I can change the formatting of the cells holding the GetItem function
but it does not change the appearance of the time values in the cell.

Is there a way to change the appearance of the time values in excel?

Share: 

 

4 Answers Found

 
Answer #1    Answered By: Tarron Thompson     Answered On: Jan 24

the likes of:
Format(Time, "h:m:s")
or
Format(Time, "Long Time")

 
Answer #2    Answered By: Vid Fischer     Answered On: Jan 24

Thank you for your reply but i am not quite following you. Can you
be a little more specific on how I can set this formatting?

 
Answer #3    Answered By: Daniel Costa     Answered On: Jan 24

I'll do you a deal. You be more specific ('body' isn't a lot to work
on. What is a time  record? How does the cell  display multiple items?
What is the collection  a collection of?), then I will be.

 
Answer #4    Answered By: Grace Ellis     Answered On: Jan 24

At present, your function  doesn't have a return type. Give it one, so that it
returns, e.g., a date.

Once you've done this, then the standard formatting  for the cell  should work.

Alternatively, return it as a string (again, give the function a return type to
ensure this happens and also to make it clear what you are doing), with the
formatting already done inside the function.

 




Tagged: