Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
RMF RMF is offline
external usenet poster
 
Posts: 6
Default Inserting time via DTpicker but per 15 min i/o per min

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default Inserting time via DTpicker but per 15 min i/o per min

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

"RMF" wrote in message
...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
In Excel: is there a way of inserting the current time (what time it is right NOW) [email protected] Excel Discussion (Misc queries) 2 May 20th 07 11:35 PM
can you use the dtpicker in an userfrom TerryR Excel Worksheet Functions 1 August 1st 05 03:20 PM
dtpicker problem Hekke Excel Discussion (Misc queries) 0 July 19th 05 04:39 PM
REPOST: Looking for how to use DTPicker Newbie1[_3_] Excel Programming 1 April 5th 04 10:46 PM
DTpicker problem Cody Dawg[_2_] Excel Programming 2 October 21st 03 04:53 AM


All times are GMT +1. The time now is 02:56 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"