Any method equivalent to PadLeft/PadRight?

前端 未结 7 1924
春和景丽
春和景丽 2020-12-03 09:23

Just wondering, is there any equivalent in VBA to VB .NET\'s PadLeft and PadRight methods?

As of right now, whenever I want to take a string and make it a fixed leng

相关标签:
7条回答
  • 2020-12-03 10:23

    You can also use fixed length strings in VBA:

    Dim myString As String * 10
        myString = "test"
        Debug.Print myString, "(" & Len(myString) & ")" '// Prints "test          (10)"
    

    although this is only useful for padding on the right.

    0 讨论(0)
提交回复
热议问题