Excel VBA 用户窗体列表框列格式
Excel VBA Userform Listbox Column Format
我正在用一系列数字填充我的列表框(仅在筛选后可见数字)。我需要将该列格式化为货币 ("$#,##0.00).
任何帮助都很棒!
我相信我已经尝试了所有方法,但正在寻找任何可能的建议。
Dim rngSize As Range
Set rngSize = ws1.Range("O12:O" & LR1).SpecialCells(xlCellTypeVisible)
With frmReportEnd.lbSize
For Each Cell In rngSize
.ColumnCount = 1
.ColumnWidths = "100"
.AddItem Cell.Value
.List(.ListCount - 1, 1) = Format(rngSize)
Next Cell
End With
Dim rngSize As Range
Set rngSize = ws1.Range("O12:O" & LR1).SpecialCells(xlCellTypeVisible)
With frmReportEnd.lbSize
.ColumnCount = 1
.ColumnWidths = "100"
For Each Cell In rngSize
.AddItem Format(Cell.Value, "$#,##0.00")
.List(.ListCount - 1, 1) = Format(rngSize)
Next Cell
End With
我正在用一系列数字填充我的列表框(仅在筛选后可见数字)。我需要将该列格式化为货币 ("$#,##0.00).
任何帮助都很棒!
我相信我已经尝试了所有方法,但正在寻找任何可能的建议。
Dim rngSize As Range
Set rngSize = ws1.Range("O12:O" & LR1).SpecialCells(xlCellTypeVisible)
With frmReportEnd.lbSize
For Each Cell In rngSize
.ColumnCount = 1
.ColumnWidths = "100"
.AddItem Cell.Value
.List(.ListCount - 1, 1) = Format(rngSize)
Next Cell
End With
Dim rngSize As Range
Set rngSize = ws1.Range("O12:O" & LR1).SpecialCells(xlCellTypeVisible)
With frmReportEnd.lbSize
.ColumnCount = 1
.ColumnWidths = "100"
For Each Cell In rngSize
.AddItem Format(Cell.Value, "$#,##0.00")
.List(.ListCount - 1, 1) = Format(rngSize)
Next Cell
End With