Any method equivalent to PadLeft/PadRight?

前端 未结 7 1938
春和景丽
春和景丽 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 09:59

    I solved the problem by reassigning variable.
    In my code I get data from workbook cell and limit it to 5 char (if necessary fill with enough 0..):

    MB = Right(String(5, "0") & Worksheets("HOME").Range("b3"), 5)
    MB = Right(MB, 5)
    

提交回复
热议问题