help on spinbutton controllinng a text or ComboBox showing time

A

adam_kroger

I need to have a TextBox (or ComboBox) on a user form that has an
associated SpinButteon be able to show a time range of 0 to 8:00 in 15
minute increments (step of .010417).

I'm thinking that a ComboBox setting the List source to an array and
using the SpinButton to move up or down the array would be the best/
simplest.

The data from the UserForm will eventually be copied into a cell that
will be included in a mathmatical function; so I need it (the data) to
not be string but the numerical value (0 - .333344). Visually it
needs to be formatted [h}:mm both in the dropdown and on the form.

More details can be provided either OnGroup or in email if needed/
wanted.

Thanks
 
M

MartinW

Hi Adam,

I think a Spinner from the Forms toolbar should do
what you want.

Format A1 and A2 to [hh]:mm
Go to View>Toolbars>Forms
Insert a spinner,
Right click on the spinner button and go to Format Control
Set the cell link to say F1
Set the increment to 1. OK out
Put this formula in A2 =A1+(0.25/24)*F1

Is that the sort of thing you are looking for?

HTH
Martin
 
M

MartinW

Re-reading your post it looks like you want to
limit it to 0:00 and 8:00.

The spinner won't go below zero so that sets your
lower limit for you.
To set the upper limit adjust the formula to
=MIN(A1+(0.25/24)*F1,8/24)

HTH
Martin



MartinW said:
Hi Adam,

I think a Spinner from the Forms toolbar should do
what you want.

Format A1 and A2 to [hh]:mm
Go to View>Toolbars>Forms
Insert a spinner,
Right click on the spinner button and go to Format Control
Set the cell link to say F1
Set the increment to 1. OK out
Put this formula in A2 =A1+(0.25/24)*F1

Is that the sort of thing you are looking for?

HTH
Martin


I need to have a TextBox (or ComboBox) on a user form that has an
associated SpinButteon be able to show a time range of 0 to 8:00 in 15
minute increments (step of .010417).

I'm thinking that a ComboBox setting the List source to an array and
using the SpinButton to move up or down the array would be the best/
simplest.

The data from the UserForm will eventually be copied into a cell that
will be included in a mathmatical function; so I need it (the data) to
not be string but the numerical value (0 - .333344). Visually it
needs to be formatted [h}:mm both in the dropdown and on the form.

More details can be provided either OnGroup or in email if needed/
wanted.

Thanks
 
A

adam_kroger

It is to be used in an UserForm. I want to try to eliminate any cell
references.
 

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

Top