24hrs in macro not recognised

tinynoo

Registered User.
Local time
Today, 08:36
Joined
Apr 15, 2008
Messages
14
My pc is set to 24hrs but my macro will not recognise it. I have 2 columns, one with date and time (time in 24hr) and the next column calculates the hour only from the 1st column. When I record the macro it works fine and the hours returned from the calculation are in 24hr as they should be.

However, when I run the macro it no longer returns the hours as 24hr but shows 1am as 1 and 1pm as 1 when it should say 1 or 24; it doesn't even say am or pm as alternative. I have tried every which way of formatting the cells to something different but no avail.

Please help...
 
Hi, tinynoo,

maybe use ActiveCell.NumberFormat = "[h]:mm" in VBA or format the cells userdefined showing the format.

Ciao,
Holger
 

Users who are viewing this thread

Back
Top Bottom