ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Formats in Listbox? (https://www.excelbanter.com/excel-programming/301926-formats-listbox.html)

CG Rosén

Formats in Listbox?
 

Good Evening,

Grateful for some hints about following;

Filling a ListBox with values from a WorkSheet with below code:
----
Item1 = Sheets(1).Cells(r, 1)
UserForm3.ListBox2.AddItem Item1
----

This is working OK, but the cells in the Sheet is formatted as numbers 1,00
0,75 0,50 etc.
When showed in the ListBox they are in text(?) format as 1 0,75 0,5.
How to make the ListBox to show all decimals as in number format?

Brgds

CG Rosén



sebastienm

Formats in Listbox?
 
Hi CG Rosén,
Replace
=Sheets(1).Cells(r, 1)
by
=Sheets(1).Cells(r, 1).Text

--
Regards,
Sébastien

CG Rosén

Formats in Listbox?
 
Thanks Sebastienm! worked perfect.

Brgds

CG Rosén

"sebastienm" wrote in message
...
Hi CG Rosén,
Replace
=Sheets(1).Cells(r, 1)
by
=Sheets(1).Cells(r, 1).Text

--
Regards,
Sébastien





All times are GMT +1. The time now is 08:43 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com