如何创建用户定义的公式而不是键入长字符串(How to create a user defined formulas instead of typing out long strings)
我正在尝试将以下公式分配给用户定义的公式,这些公式通常会粘贴到单元格中。
=串连(文本(A2, “000000”), “ - ”,文本(A3, “000”))
我需要文本部分格式化,并在连字符前最多6位数的前导零和连字符后最多3位数。 我想将它分配给格式(Selection1,Selection2),其中选择1将是A2,选择2将是A3,例如,这样我就可以避免必须一直输出整个字符串。
I am trying to assign the following formulas that i would normally paste into a cell to a user defined formula.
=concatenate(text(A2,"000000"),"-",text(A3,"000"))
I need the text portion to format and get leading zeros up to 6 digits before the hyphen and up to 3 digits after the hyphen. I wanted to assign it to Format(Selection1, Selection2) where selection 1 would be A2 and selection 2 would be A3 for example so that I could avoid having to type out that entire string all the time.
最满意答案
Function blah(A, B) blah = Format(A, "000000") & "-" & Format(B, "000") End Function Function blah(A, B) blah = Format(A, "000000") & "-" & Format(B, "000") End Function更多推荐
发布评论