Excel Combo Box Formatting problem

  • Thread starter Thread starter Dan McCloud
  • Start date Start date
D

Dan McCloud

hello all,

I am trying to take a list of times (starting with 12:00 AM, 12:15 AM,
12:30 AM, etc. all the way to 11:45 PM) in one sheet and populate a
combo box in another sheet with these times for time entry. That part
I can handle.

However, when I click the box and transfer the value of the combo box
to the designated cell, I can't seem to format the resultant decimal
number (i.e. 0.62500002 for 3:00 PM) as a time.

I suspect that the problem lies with the fact that I can't seem to
change the data type of the combo box. It looks like it is a string
and the resultant number is actually a string.

One final observation before I pose the relevant questions: If I
click the combo box and get a value in the designated cell and then
click that cell and click into the 'formula edit bar' of the cell
(where you would edit a formula), as soon as I click out of the cell,
it changes to the desired format (3:00 PM).

So here are the questions:

1. Is there a way to change the data type of the combo box?

2. Is there a work around to this problem besides trying to change
the data type?
 
Tom,

Thanks again for your help. I seem to have found a work around. I
didn't want to have to get into coding any of this, but this simple
piece of code seemed to do the trick. I wanted to follow up so that
anyone else with this problem may benefit.


Here's the code:

Range("B10").Select
ActiveCell.FormulaR1C1 = ComboTime.Text
 
Back
Top