time box

  • Thread starter Thread starter Ed
  • Start date Start date
E

Ed

I want to make a box which is in military time tied back to a range of cells.
Can it be done and how could it be easily done. Thanks for help
 
Four steps:

1. insert this User Defined Function:

Function gmt() As Date
Application.Volatile
dot = "."
Set Serve = GetObject("winmgmts:\\" & dot & "\root\cimv2")
Set Zones = Serve.ExecQuery("Select * From Win32_TimeZone")

For Each Zone In Zones
intTimeZoneBias = Zone.Bias
intDayLightBias = Zone.DaylightBias
Next

gmt = Now() - (intTimeZoneBias - intDayLightBias) / (60 * 24)

End Function

2. in cell A1, enter:

=gmt()

3. put a rectangle on your worksheet using the Drawing toolbar

4. click on the rectangle to select it and then click in the formula bar and
enter:

=A1
 
Right-click on the cell you want to be your 'box'.
Select 'Format Cells...' from the menu.
Select 'Time'
Select the military time format you want.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top