programatically formating a cell/cellrange

How do I programatically format a cell/cellrange  to General Date or Time Value from VB.NET.
The problem I'm having is I've got a formula that is returning a serial Value instead of Hour:Minutes:Sec in my excel sheet. I tought about using the Hour,Minute and second Function of Excel (and its working BUT its not formating the values properly for me.

Alternatively if I can find the Excel equivalent of VB.NET's funtion Format(String,"00"), I'll be good.
LVL 7
the_bachelorAsked:
Who is Participating?
 
Harisha M GConnect With a Mentor Commented:
Range("A1:A100").NumberFormat = "hh:mm:ss"
0
 
Harisha M GCommented:
Hi the_bachelor,

Range("A1:A100").NumberFormat = "dd/mm/yyyy"

Cheers!
0
 
the_bachelorAuthor Commented:
mgh_mgharish, thats giving me a Day-Month-Year.
I need Hour-Minute-Second.
I Tried Range("A1:A100").NumberFormat = "T" but its a nogo.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.