• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Schedules with Interval in combobox

S P P

Member
Schedules with Interval in combobox
 

Attachments

  • Schedules with Interval in combobox.xlsm
    22.5 KB · Views: 3
S P P
  • When drafting a question, try and lay out the question in a clear and concise way.
  • Try and tell the readers what is the situation, what have you tried and what do you want to achieve.
  • Don't leave out information more info is better
 
Code:
Private Sub UserForm_Initialize()
HI = TimeSerial(Planilha1.Range("B2"), 0, 0)
HF = TimeSerial(Planilha1.Range("C2"), 0, 0)
M = TimeSerial(0, Planilha1.Range("D2"), 0)
For I = HI To HF Step M
  ComboBox1.AddItem Format(I, "hh:mm")
Next I
ComboBox1.ListIndex = 0
End Sub
 
if
B2 =08;30
C2 = 19:50
D2 = 00:20

I tried to change in the VBA that I wrote to have this other option

Swapping TimeSerial for Format but it didn't work.

Is there any way to help me if the time is fractional.

I'm already waiting
 
84444
Code:
Private Sub UserForm_Initialize()
HI = Planilha1.Range("B2")
HF = Planilha1.Range("C2")
M = Planilha1.Range("D2")
For I = HI To HF Step M
  ComboBox1.AddItem Format(I, "hh:mm")
Next I
ComboBox1.ListIndex = 0
End Sub
 
It didn't work something went wrong
 

Attachments

  • Schedules with Interval in combobox1.xlsm
    26.8 KB · Views: 2
Back
Top