Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() This procedure for a textbox increments time by 15 minutes. I want to change it so that the content is a simple number in format "#0.00" and the KeyDown increments the number by 0.25 Private Sub txtStartTime_KeyDown(ByVal KeyCode _ As MSForms.ReturnInteger, _ ByVal Shift As Integer) Dim sDate As String Dim v As Integer dte As Date Select Case KeyCode Case 37 ' Left v = -1 Case 39 ' Right v = 1 Case Else v = 0 End Select sDate = txtStartTime.Text If IsDate(sDate) And v < 0 Then dte = CDate(sDate) dte = dte + v * TimeValue("00:15") txtStartTime = Format(dte, "h:mm AM/PM") End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Increment number on command | Excel Programming | |||
Increment number on command | Excel Programming | |||
Textbox Keydown event not triggered. | Excel Programming | |||
increment number by code | Excel Programming | |||
Increment number by 1 | Excel Programming |