Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Excel Combo Box Formatting problem

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Excel Combo Box Formatting problem

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


"Tom Ogilvy" wrote in message ...
If isdate(Combobox1.Text) then
With worksheets("sheet1").Range("A1")
.Value = cdate(Combobox1.Text)
.NumberFormat = "hh:mm:ss"
End With
End if

Dates and time are all one format.

--
Regards,
Tom Ogilvy

"Dan McCloud" wrote in message
om...
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?

Reply
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
Combo box problem R Ormerod Excel Discussion (Misc queries) 1 August 14th 07 01:12 PM
Combo box problem R Ormerod Excel Discussion (Misc queries) 3 August 13th 07 09:52 AM
Simple combo box problem JonathanW Excel Discussion (Misc queries) 1 March 23rd 07 11:53 AM
combo box problem in Excel Tvnguye Excel Discussion (Misc queries) 1 December 23rd 05 03:37 AM
Combo Box problem tmjhiphopcom Excel Discussion (Misc queries) 2 November 6th 05 05:30 PM


All times are GMT +1. The time now is 03:21 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"