Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Combobox number formats

HYCH
Am using the code below, to pull back the a list of Times (format
hh:mm)

But still shows as decimal numbers


any help please !!!


Private Sub UserForm_Initialize()
Dim cPart As Range
Dim ws As Worksheet
Set ws = Worksheets("Lists")
For Each cPart In ws.Range("C1:C88")
With Me.ComboBox1
.AddItem cPart.Value
.List(.ListCount - 1, 1) = Format(cPart.Offset(0, 1).Value,
"hh:mm")
End With
Next cPart
Me.ComboBox1.Value = ""
Me.ComboBox1.SetFocus
End Sub


Steve

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default Combobox number formats

The .AddItem line is what's adding the text to the combo box - shouldn't this
be where you put Format(cPart.Value, "hh:mm")?

"Steve" wrote:

HYCH
Am using the code below, to pull back the a list of Times (format
hh:mm)

But still shows as decimal numbers


any help please !!!


Private Sub UserForm_Initialize()
Dim cPart As Range
Dim ws As Worksheet
Set ws = Worksheets("Lists")
For Each cPart In ws.Range("C1:C88")
With Me.ComboBox1
.AddItem cPart.Value
.List(.ListCount - 1, 1) = Format(cPart.Offset(0, 1).Value,
"hh:mm")
End With
Next cPart
Me.ComboBox1.Value = ""
Me.ComboBox1.SetFocus
End Sub


Steve


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Combobox number formats

On 23 Oct, 12:44, Smallweed
wrote:
The .AddItem line is what's adding the text to the combo box - shouldn't this
be where you put Format(cPart.Value, "hh:mm")?



"Steve" wrote:
HYCH
Am using the code below, to pull back the a list of Times (format
hh:mm)


But still shows as decimal numbers


any help please !!!


Private Sub UserForm_Initialize()
Dim cPart As Range
Dim ws As Worksheet
Set ws = Worksheets("Lists")
For Each cPart In ws.Range("C1:C88")
With Me.ComboBox1
.AddItem cPart.Value
.List(.ListCount - 1, 1) = Format(cPart.Offset(0, 1).Value,
"hh:mm")
End With
Next cPart
Me.ComboBox1.Value = ""
Me.ComboBox1.SetFocus
End Sub


Steve- Hide quoted text -


- Show quoted text -


What a star, of course, thanks Small

:)

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Combobox number formats

See one answer in microsoft.public.excel

Please don't post the same question to multiple newsgroups. It tends to
fragment any answers you get, and it potentially wastes the time of
those responding to questions that have already been answered in another
group.

In article . com,
Steve wrote:

HYCH
Am using the code below, to pull back the a list of Times (format
hh:mm)

But still shows as decimal numbers


any help please !!!


Private Sub UserForm_Initialize()
Dim cPart As Range
Dim ws As Worksheet
Set ws = Worksheets("Lists")
For Each cPart In ws.Range("C1:C88")
With Me.ComboBox1
.AddItem cPart.Value
.List(.ListCount - 1, 1) = Format(cPart.Offset(0, 1).Value,
"hh:mm")
End With
Next cPart
Me.ComboBox1.Value = ""
Me.ComboBox1.SetFocus
End Sub


Steve

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Combobox number formats

On 23 Oct, 12:53, JE McGimpsey wrote:
See one answer in microsoft.public.excel

Please don't post the same question to multiple newsgroups. It tends to
fragment any answers you get, and it potentially wastes the time of
those responding to questions that have already been answered in another
group.

In article . com,



Steve wrote:
HYCH
Am using the code below, to pull back the a list of Times (format
hh:mm)


But still shows as decimal numbers


any help please !!!


Private Sub UserForm_Initialize()
Dim cPart As Range
Dim ws As Worksheet
Set ws = Worksheets("Lists")
For Each cPart In ws.Range("C1:C88")
With Me.ComboBox1
.AddItem cPart.Value
.List(.ListCount - 1, 1) = Format(cPart.Offset(0, 1).Value,
"hh:mm")
End With
Next cPart
Me.ComboBox1.Value = ""
Me.ComboBox1.SetFocus
End Sub


Steve- Hide quoted text -


- Show quoted text -


Sorry JE,

Misc, seems to be very slow just recently, and meant to poast it here.

apologies

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
Number formats Pat Excel Discussion (Misc queries) 5 October 1st 07 04:15 AM
Number Formats Michelle Excel Discussion (Misc queries) 2 August 27th 07 09:39 AM
VB number formats Gary Keramidas Excel Programming 0 December 11th 06 09:17 PM
number formats blackbox Excel Worksheet Functions 8 April 10th 06 06:13 AM
Combobox Number Formats LostInVBA Excel Worksheet Functions 0 June 30th 05 09:11 PM


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