ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

§âExcel ¸ê®Æ¶×¥X¬°¯Â¤å¦r ¨Ã¶ñ¤J©T©w­È

§âExcel ¸ê®Æ¶×¥X¬°¯Â¤å¦r ¨Ã¶ñ¤J©T©w­È

½Ð°Ý  §Ú¦³¤@±iexcelªí


ªíÃþ        ªÑ²¼¥N½X        ¦~¥÷        ¼Æ¦rA              ¼Æ¦rB
A01        6271                 96                 55.6              0.27
       
ªÑ²¼¥N¸¹   «e­±¸É4­Ó0       
¦~¤À           «á­±¸É3­Ó0
¼Æ¦rA       «e­±¸É4­Ó0(¤]´N¬O¤p¼ÆÂI«e­n¦³8½X),¨ú¨ì¤p¼Æ²Ä¤T¦ì,¥B¤p¼ÆÂI¤£­n->000055600
¼Æ¦rB      ¦P«e --> 000000270

³Ì«áµ²ªG-->A010000627196000000055600000000270

§Ú·Q­n¦A©T©wªº®æ¤l¶ë¤J©T©wªº­È   ¨Ã²£¥X¦¨txtÀÉ~
½Ð°ÝVBA­n«ç»ò¤~¯à°µ¨ì

§Ú·|²£¥XTXTÀÉ~~¦ý§Ú¥d¦A¶ë¤J©T©w­È

©Î¬O¤£¥ÎVBA¤]¥i¥H  ¦³¬Æ»ò¨ç¼Æ¥i¥H¹F¨ì³oºØ¥\®Ä¹À??

½Ð¦U¦ì¤j®vÀ°¦£~ÁÂÁÂ

DATA.zip (7.1 KB)

¥»©«³Ì«á¥Ñ stillfish00 ©ó 2015-2-3 16:37 ½s¿è

¦^´_ 1# zero1019
¦pªG­n¸É¹sªº³£¬O¼Æ¦r¥i¥H¥Îformat¨ç¼Æ´N¦n¡A¦pªGÁÙ¥]§t¦r¥À¡A¥i¥H¦Û¤v¼g...
  1. Function FillStrZero(strIn As String, digit As Integer, Optional fromLeft As Boolean = True) As String
  2.   If Len(strIn) > digit Then Err.Raise vbObjectError + 9999, , "String length should not larger than " & digit & "digit."
  3.   FillStrZero = IIf(fromLeft, String(digit - Len(strIn), "0") & strIn, strIn & String(digit - Len(strIn), "0"))
  4. End Function
½Æ»s¥N½X
test
  1. Sub Test()
  2.   MsgBox [A2] & FillStrZero([B2], 8) & FillStrZero([C2], 5, False) & FillStrZero(Round([D2] * 1000), 9) & FillStrZero(Round([E2] * 1000), 9)
  3. End Sub
½Æ»s¥N½X
ªí¹F¤£²M¡BÃD·N¤£©ú½T¡B¨SªþÀɮ׮榡¡B¨S¦³°Q½×°ÝÃDªººA«×~~~~~~¥H¤W·R²ö¯à§U¡C

TOP

¦^´_ 1# zero1019
  1. =A2&TEXT(B2,REPT("0",8))&C2*1000&TEXT(D2*1000,REPT("0",9))&TEXT(E2*1000,REPT("0",9))
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¤@­Ó¯Ê¤fªºªM¤l¡A¦pªG´«¤@­Ó¨¤«×¬Ý¥¦¡A¥¦¤´µM¬O¶êªº¡C
ªð¦^¦Cªí ¤W¤@¥DÃD