Hello,
I am trying to create a listbox that displays a table from a worksheet ('Liquid Charge Control Sheet') using the code below. The worksheet displays only one decimal place (i.e. 100.5) but when I reference that cell in the listbox it displays "100.50000000000000". Can someone show me how to display only one decimal place in the listbox? Thanks!
I am trying to create a listbox that displays a table from a worksheet ('Liquid Charge Control Sheet') using the code below. The worksheet displays only one decimal place (i.e. 100.5) but when I reference that cell in the listbox it displays "100.50000000000000". Can someone show me how to display only one decimal place in the listbox? Thanks!
Code:
Private Sub Table_CommandButton_Click()
Dim ws As Worksheet
Dim rng As Range
Dim MyArray
Set ws = Sheets("Liquid Charge Control Sheet")
Set rng = ws.Range("F31:H" & ws.Range("F" & ws.Rows.Count).End(xlUp).Row)
With Me.ListBox1
.Clear
.ColumnHeads = False
.ColumnCount = rng.Columns.Count
MyArray = rng
.List = MyArray
.ColumnWidths = "50;50"
.TopIndex = 0
End With
End Sub