posted by
oldbloke at 03:44pm on 03/04/2006
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Private Sub ComboBox11_Change()
'we need newval to be a string or it'll get the numeric representation of the entered time
Dim newval As String
If ComboBox11.Value = "Add time" Then
newval = InputBox("Enter new time")
ComboBox11.Value = newval
numitems = Sheets("Lists").Cells(2, timecol).Value + 1
Sheets("Lists").Cells(2, timecol).Value = numitems
'even though we made sure newval is a string, it'll get converted again unless we stick a ' in front
Sheets("Lists").Cells(numitems + 2, timecol).Value = "'" & newval
nfr = "Lists!" & timecolc & "3:" & timecolc & numitems + 2
ComboBox2.ListFillRange = nfr
End If
End Sub
'we need newval to be a string or it'll get the numeric representation of the entered time
Dim newval As String
If ComboBox11.Value = "Add time" Then
newval = InputBox("Enter new time")
ComboBox11.Value = newval
numitems = Sheets("Lists").Cells(2, timecol).Value + 1
Sheets("Lists").Cells(2, timecol).Value = numitems
'even though we made sure newval is a string, it'll get converted again unless we stick a ' in front
Sheets("Lists").Cells(numitems + 2, timecol).Value = "'" & newval
nfr = "Lists!" & timecolc & "3:" & timecolc & numitems + 2
ComboBox2.ListFillRange = nfr
End If
End Sub
There are no comments on this entry. (Reply.)