View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] ed@dmcassoc.com is offline
external usenet poster
 
Posts: 1
Default Time format behaviour

The destination column must be formatted to the HHmm.
-----Original Message-----
I have a problem where I am copying data from one

worksheet to another and I
am also changing the time format from HH:mm to HHmm. To

do this I am using
this code.

Worksheets("Sheet2").Cells(PasteRow, 16) = Format

(DepTime, "HH" & "mm")

The problem is that the hour figure does not show the

leading zero even
though I have requested it, HH rather than H. The

leading zero is a
requirement. To complicate matters I would only want to

format the cell to
display leading zeros as a last resort. Any ideas would

be most appreciated
.