• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 346
  • Last Modified:

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.
0
the_bachelor
Asked:
the_bachelor
  • 2
1 Solution
 
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
 
Harisha M GCommented:
Range("A1:A100").NumberFormat = "hh:mm:ss"
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now