Help with Time Input

M

mkadon

Hello,



I am working on building a spreadsheet that would enable the user to easily
select the specific time they are looking for using the format MM/DD/YYYY
00:00:00 AM/PM.



Does anyone have any examples or suggestions on automating this task, such
as a macro or drop down menus for easily selecting the input?



Thank you,

Mark
 
D

David McRitchie

Huh? Surely you don't mean a drop down for every second of every
day from Jan 1st 1900 to eternity.

I don't know what you are really looking for but it would be faster to
just type in the date and time than to go through dropdowns for
each of year/month/dayofmonth/hour/minute/second/AM(/PM)

Doesn't really fit your idea of the user selecting the date and time that
they want, but here is something to automate a current datetimestamp.

if you are trying to
enter the current time you could use the shortcut ctrl+; (semi-colon)
or you could automate entering the current datetimestamp with an
Event macro
http://www.mvps.org/dmcritchie/excel/event.htm#autotime

modified from
Place current time constant in Column A when Column B changes (#autotime)
suggest formatting column A to the desired format for most
efficient formatting, but you can activate the comment if you want.

Private Sub Worksheet_Change(ByVal Target As Range)
'to install -- right-click on the sheettab of the sheet to
' be used in and choose 'view code'. Paste this Worksheet
' event macro into the module.
If Target.Column <> 2 Then Exit Sub
If Target.Row = 1 Then Exit Sub
If IsEmpty(Target.Offset(0, -1)) Then
Target.Offset(0, -1) = Now
'-- Target.Offset(0, -1).NumberFormat = "MM/DD/YYYY 00:00:00 AM/PM.
End If
End Sub
 

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

Top