有没有办法在Excel VBA表单列表框中包装文本?

时间:2017-01-04 08:22:18

标签: forms vba excel-vba listbox line-breaks

有没有办法在Excel VBA表单列表框中包装文本?

item = item & WorksheetFunction.Rept(" ",30 - Len(item))
    subtotal = WorksheetFunction.Rept(" ", 10 - subtotal_pad) & _
        "$ " & WorksheetFunction.Rept(" ", subtotal_pad - Len(Format(subtotal, "0.00"))) & Format(subtotal, "0.00")
    taxed = "  "
        If tax_rate <> 0 Then
            taxed = " T"
        End If
    description = ""
        If description <> "" Then
            description = vbNewLine & "  - " & description
        End If
    quantity = ""
        If unit <> "ea" Then
            quantity = vbNewLine & "  - " & quantity & " @ $" & Format(cost, "0.00#") & "/" & unit
        End If

    lbxCharges.AddItem (item & subtotal & taxed & description & quantity)

它的外观如下: no line breaks

但这应该是它的样子: with line breaks

0 个答案:

没有答案