Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2006

Tip: Looking for answers? Try searching our database.

Inserting time via DTpicker but per 15 min i/o per min

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
RMF - 22 Mar 2006 22:56 GMT
Dear users,

I have made a userform with a DTpicker that I use to insert time into a
cell. If I run the macro and open the userform I can enter the time but
besides hours I have to scroll through the minutes to set the time on hh:15,
hh:30, hh:45 and hh:59. I only need to use these 4 options. I dont have to be
able to select hh:34 or hh:07. I just need 15 min. intervals.

Any ideas on how to do this? I am not such a code expert, so all help is
appreciated!

R
Doug Glancy - 23 Mar 2006 00:47 GMT
RMF,

I can't figure how to make DTPicker work that way.  Instead you could try
creating a listbox and inserting this code in your form:

Private Sub UserForm_Initialize()
Dim i As Long
For i = 0 To 1439
   Me.ListBox1.AddItem (Format(i * 15 / 1440, "HH:MM AM/PM"))
Next i
End Sub

Private Sub CommandButton1_Click()
ActiveSheet.Range("A1") = Format(CDate(Me.ListBox1), "HH:MM AM/PM")
End Sub

hth

Doug

> Dear users,
>
[quoted text clipped - 8 lines]
>
> R
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.