Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel 97 Combo box 1

Status
Not open for further replies.

ohmbru2

Technical User
Jul 24, 2001
51
US
I created a combo box that works how expected, except for the format. The referenced list contains cells formatted as time (0:00). The combo box list them corectly, but when selected returns a number with several decimal places (3.3333333333E).

I looked through all the properties and could not find a one that would let me format the data in the combo box.

Thanks in advance for any help,

Brian
 
Hi Brian, Bryan here!

You should be able to manipulate this particular bit of code to fit in with your particular circumstances:

Private Sub ComboBox1_Change()
ComboBox1.Value = Format(ComboBox1.Value, "hh:mm")
End Sub

I have written the code so that it's reformatted after teh value of teh combo box is changed. However, you're probably the best judge of when the event should be initiated.

Cheers.

Bryan.
 
Thanks for the response! That did the trick.

 
Follow-up:

Now I can get the value in the format I was looking for, but for some reason when I sum the cell the combobox points to, the sum formula doesn't "see" it. I have verified that the List Range, combobox, and Linked Cell are all formatted the same. But, still my formula does not recognize the linked cell.
 
Me no understandy.

Your combo box works OK.
Your combo box is linked a cell which contains the sum of values from other cells.

????

Confused. SuperBry!
 
I'm adding a series of LinkedCells which get thier value via the comboboxes. The previous version of the spreadsheet used the sum function (when the times were not entered w/ the combobox). After changing to the combobox, the formula no longer worked.

I have since sovled this by changing the formula to:

A1+B1+C1+D1

rather than Sum(A1:D1)

Thanks for your help!

Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top