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

½Ð±Ð¾Þ§@ excel vba ª½®Ñ¾î®Ñ¾Þ§@

½Ð±Ð¾Þ§@ excel vba ª½®Ñ¾î®Ñ¾Þ§@

½Ð±Ð¾Þ§@ excel vba ª½®Ñ¾î®Ñ¾Þ§@

¦Û±q

½Ð±Ð¡A¦p¦óÁôÂÃÀx¦s®æ¤ºªº¹Ï¤ù¡H¦p¦ó§Ö³t«ü©w¦C¦L­¶¡H
http://forum.twbts.com/viewthread.php?tid=10659

¾Ç·|¦p¦ó®Mªí¦C¦L«á¡A¤u§@®Ä²vÅܧ֤F¡A¦Ò¸Õ³£¦Ò100¤À

²{¦b§Ú¤S¹J¨ì²~ÀV¤F

¥Ø«eªº°ÝÃD¥d¦b ¤¤¤å«H«Ê ¦a§}ªº ª½®Ñ ¾î®Ñ ¹ï¼Æ¦rªº¼vÅT

¤@¡Bword ª½®Ñªº§}¦a³Ì¦n

°ª¶¯¥«¤T¥Á°Ï³Õ·R¢²¬q123¸¹10§Ë2¼Ó

°ª
¶¯
¥«
¤T
¥Á
°Ï
³Õ
·R
¢²
¬q
123
¸¹
10
§Ë
2
¼Ó

·íµM¡A³Ì¦nªº¦a§}Åã¥Ü¡AÀ³¸Ó¹³³o¼Ë

¦ý¬O word ¤w¸g°÷¦n¤F¡A¤£±j¨D¡A­ì¥»¥´¦L¦a§}¬O¥Îword ±Æ¦nª©¤§«á¡A¥Î¦X¨Ö¦C¦L¾Þ§@¥X¨Óªº

¾Ç·| excel ®Mªí¡A´N¾ã­Ó§ï¨ì excel ¤W¤F

¤G¡B¦bexel ¤W¡AµL½×¬O¾î®Ñ ¥[¤W±j¨î´«¦æ¡A©Îª½®Ñ¡A ¼Æ¦rªºÅã¥Ü®ÄªG³£¤£¦n

https://www.dropbox.com/s/h9slna0wnwuzlhu/letter_test.xls
±q´ú¸ÕÀÉ¥i¥H¬Ýªº¥X¨Ó¡C

¤T¡B«á¨Ó§Úµo²{ excel ¥i¥H´¡¤J->ª«¥ó->word ¤åÀÉ

¥Î³o¼Ëªº¤è¦¡´N¥i¥H±N word ªºÅã¥Ü¤è¦¡§Ë¨ì excel ¤W¤F

²{¦bÅܦ¨¥d¦b vba ­n«ç»ò¼g¡H­ì¥» .[i3] = E.Range("d1")                           'µo²¼¦a§}

´N¯à·d©w¡A²{¦b§Ú§¹¥þ¤£ª¾­n¦p¦ó¤U¤â

­ì¥»¦³¥Î ¥¨¶°ªº¤è¦¡¸Õ´ú¡A¥uµo²{ ActiveSheet.Shapes("Object 18").Select¡A

±µ¤U¨Óªºword¹Ï¤å®Øªº¤º®e­n±q¦ó¤U¤â¥h­×§ï«h§¹¥þ¨SÀY§Ç

¥»©«³Ì«á¥Ñ eigen ©ó 2013-11-20 15:26 ½s¿è

¨S·Q¨ì³o»ò²³æ´N¹F¨ì¤F³Ì²z·Qªº°µªk¡A³s ´¡¤Jword³£¤£¥Î

§Ú¤S¥[¤J  Replace(E.Range("d1").Value, "-", "¤§")  Åý -Åܦ¨ ¤§ ¡A¾ã­Óperfect!!! 100¤À

¤Ó·PÁ¤F~~

TOP

¥»©«³Ì«á¥Ñ stillfish00 ©ó 2013-11-20 14:50 ½s¿è

¦^´_ 2# eigen
¼Ò²Õ·s¼WFunction:
  1. Function StrToVertical(s As String) As String
  2.   With CreateObject("vbscript.regexp")
  3.     .Global = True
  4.     .Pattern = "(\d+|[^\d])"
  5.     StrToVertical = .Replace(s, "$1" & vbLf)
  6.   End With
  7. End Function
½Æ»s¥N½X
PrintPage() ¤¤
  1. .[i3] = E.Range("d1")
½Æ»s¥N½X
§ï¬°
  1. .[i3] = StrToVertical(E.Range("d1").Value)
½Æ»s¥N½X

TOP

¤W­±§Ú¹ê§@ªº´ú¸ÕÀɵ¹¿ù¤F¡A³o­Ó¤~¹ï

https://dl.dropboxusercontent.com/u/12575824/letter_test.xls

TOP

        ÀR«ä¦Û¦b : ªY½à§O¤H´N¬O²øÄY¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD