TextBox and Time

  • Thread starter Thread starter Soniya
  • Start date Start date
S

Soniya

Hi All,

How we can restrict only time with ten minutes interval are entered
into a text box?
Is it possible to acheive this using mode function?

i want only 0.0,0.1,0.2,0.3,0.4,0.5,1.0,1.1,1.2, etc to be entered in
the text box

TIA
Soniya
 
maybe you could use a combobox with a dropdown pointing to the rowsource
with your data. also, maybe you could use data validation in the cell the
textbox was going to fill.

just some thoughts, didn't test anything
 
Soniya,

If the idea is to limit your inputs to one decimal place only for
values below the multiples of 0.5 ie effectively for 0.0 to 0.5; 1.1
to 1.5; 2.1 to 2.5 etc. then you can try:

If Application.Round(TextBox1.Value,1)
-Int(Application.Round(TextBox1.Value,1)) <=0.5 Then
Application.Round(TextBox1.Value,1)

And if you desire to have values above 0.5 to be rounded up, institute
the above with a qualification as below:

If Application.Round(TextBox1.Value,1)
-Int(Application.Round(TextBox1.Value,1)) <=0.5 Then
Application.Round(TextBox1.Value,1) *Else
Application.RoundUP(TextBox1.Value,1)*

Myles.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top