Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
lost decimal places
I am using the next code in order to place some values from a list to
cells the code works fine except if the values has decimal places When the values are pasted at cells they are loosing their decimal places. For i = 0 To Me.ListBox1.ListCount - 1 For j = 0 To Me.ListBox1.ColumnCount - 1 Worksheets("TEMPPINAKAS").Cells(i + 2, j + 2).Value = Me.ListBox1.List(i, j) Next j Next i Any ideas. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
lost decimal places
Are your cells formatted to show no decimal places? If you select the cell
and look in the formulabar, does it display the decimal portion? For i = 0 To Me.ListBox1.ListCount - 1 For j = 0 To Me.ListBox1.ColumnCount - 1 With Worksheets("TEMPPINAKAS") .Cells(i + 2, j + 2).Value = _ Me.ListBox1.List(i, j) if instr(Me.Listbox1.List(i,j),".") then .Cells(i + 2, j + 2).NumberFormat = "General" end if End With Next j Next i If your decimal separator is a comma rather than a period (full stop) then you might need to do For i = 0 To Me.ListBox1.ListCount - 1 For j = 0 To Me.ListBox1.ColumnCount - 1 With Worksheets("TEMPPINAKAS") .Cells(i + 2, j + 2).Value = _ cDbl( Me.ListBox1.List(i, j)) end if End With Next j Next i -- Regards, Tom Ogilvy GUS wrote in message ... I am using the next code in order to place some values from a list to cells the code works fine except if the values has decimal places When the values are pasted at cells they are loosing their decimal places. For i = 0 To Me.ListBox1.ListCount - 1 For j = 0 To Me.ListBox1.ColumnCount - 1 Worksheets("TEMPPINAKAS").Cells(i + 2, j + 2).Value = Me.ListBox1.List(i, j) Next j Next i Any ideas. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Decimal places | Excel Worksheet Functions | |||
Subtracting two 2-decimal place numbers gives result 13-decimal places? | Excel Worksheet Functions | |||
Decimal Places | Excel Discussion (Misc queries) | |||
FIXED 2 DECIMAL PLACES, MUST ENTER ALL ZEROES AFTER DECIMAL POINT. | Excel Discussion (Misc queries) | |||
decimal places | Excel Discussion (Misc queries) |