LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default xl97 userform combobox time

How do I write a routine (xl97) to fill a combo box on a userform with
the time starting at 12:00 AM and ending at 11:45 PM?

I populated a combo box from the times on a worksheet and wrote this. It
works. (cells A1 thru A96 have 12:00 AM, 12:15 AM, etc...)

Sub build_combobox1()

Dim x As Date

With Worksheets("Sheet3")
For x = 1 To 96
ComboBox1.AddItem .Cells(x, 1)
Next x
End With

End Sub

But I rather build the data instead of getting it. Something like this
which does not work. (the value of x I can't figure out)

Sub build_combobox1()

Dim x As Date

For x = 1200 To 2400 Step 15
ComboBox1.AddItem Format(x, "hh:mm AMPM")

Next x

End Sub



 
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
Value From ComboBox On UserForm jlclyde Excel Discussion (Misc queries) 3 October 16th 09 01:43 PM
ComboBox on a UserForm LLoyd Excel Worksheet Functions 2 February 20th 08 09:01 PM
XL97 vs XL? Recalc-time CLR Excel Discussion (Misc queries) 10 November 30th 05 01:57 PM
Userform w/ComboBox D.Parker Excel Discussion (Misc queries) 2 May 6th 05 04:28 PM
ComboBox on UserForm Michel[_4_] Excel Programming 2 July 31st 04 10:11 PM


All times are GMT +1. The time now is 09:42 AM.

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"