Link to home
Start Free TrialLog in
Avatar of the_bachelor
the_bachelor

asked on

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.
Avatar of Harisha M G
Harisha M G
Flag of India image

Hi the_bachelor,

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

Cheers!
Avatar of the_bachelor
the_bachelor

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of Harisha M G
Harisha M G
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial