Any method equivalent to PadLeft/PadRight?

前端 未结 7 1935
春和景丽
春和景丽 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:15

    Since we generally pad on the left side, the Format() function is shorter, simpler:

    Format(number, "    ")
    
    Format(number, "00")
    

提交回复
热议问题