ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Format VB command (https://www.excelbanter.com/excel-programming/418639-format-vbulletin-command.html)

kirkm[_7_]

Format VB command
 

x = "2:01"

debug.print format (x,"0# ##")

I get 00 00

Shouldn't this return

02 01 ??

Thanks - Kirk

Andy Pope

Format VB command
 
Hi,

x is representing time so use

format("2:01","hh mm")

Cheers
Andy
--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"kirkm" wrote in message
...

x = "2:01"

debug.print format (x,"0# ##")

I get 00 00

Shouldn't this return

02 01 ??

Thanks - Kirk



Mike H

Format VB command
 
Kirk,

What is "2:01" a time?

if so

Debug.Print Format(x, "hh:mm")
returns 02:01

Debug.Print Format(x, "hh mm")
returns 02 01

Mike


"kirkm" wrote:


x = "2:01"

debug.print format (x,"0# ##")

I get 00 00

Shouldn't this return

02 01 ??

Thanks - Kirk


kirkm[_7_]

Format VB command
 
Thanks Mike & Andy.

Sanity restored!

Cheers - Kirk


All times are GMT +1. The time now is 12:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com