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

[µo°Ý] ¤å¦rÀɧQ¥Î¿ý»s¥¨¶°,°}¦C³Q¿ý«á¦¨³o¼Ë¤l,¦p¦ó¸ÑÄÀ?

[µo°Ý] ¤å¦rÀɧQ¥Î¿ý»s¥¨¶°,°}¦C³Q¿ý«á¦¨³o¼Ë¤l,¦p¦ó¸ÑÄÀ?

ChDir "C:\Users\VINCENT\§Úªº¸ê®ÆÀÉ\¹êÅç\¸ê®ÆÀÉ"
Workbooks.OpenText Filename:="C:\Users\VINCENT\§Úªº¸ê®ÆÀÉ\¹êÅç\¸ê®ÆÀÉ\¹êÅçdat.txt", _
     Origin:=950, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=Array( _
     Array(0, 2), Array(4, 2), Array(7, 2), Array(9, 2), Array(11, 2), Array(12, 2), Array(14, 2) _
     , Array(16, 2), Array(18, 2), Array(20, 2), Array(22, 2), Array(24, 2), Array(26, 2), Array( _
     28, 2), Array(30, 2), Array(32, 2), Array(34, 1))

1)¥Ø«e¯à²z¸Ñªº¬O:"¹êÅçdat.txt"³Q¤À³Î¦¨,0-4-7-9......-32-34,¤@Äæ¤@Ä檺¸ê®Æ,µM«á±Æ¦C¾ã»ôªº©ñ¶i¤u§@²M³æ¤¤,¦ý¬O Array(Array(0,2),Array(4,2).....Array(32,2),Array(34,1))¤¤,Array( , )
   ²Ä¤@­Ó¤Þ¼Æ¬OÀɮתºÄæ¦ì¤À³Î,¨º²Ä¤G­Ó¤Þ¼Æ¬O¤°»ò?

2)¦³Array( ,2),¦³ Array( ,1), 2©M1 ¦U¥Nªíªº·N¸q¬°¦ó?
V98

VBA»¡©ú:
FieldInfo ¿ï¥Î Variant ¥]§t­Ó§O¸ê®ÆÄæ­åªR¸ê°Tªº°}¦C¡C¦¹ÂàĶ·|¨Ì DataType ªº­È¦Ó©w¡C·í¤À¹j¸ê®Æ®É¡A¦¹¤Þ¼Æ¬°¤G¤¸¯À°}¦Cªº°}¦C¡A¨ä¤¤¨C­Ó¤G¤¸¯À°}¦C³£·|¬°¯S©wÄæ«ü©wÂà´«¿ï¶µ¡C²Ä¤@­Ó¤¸¯À¬°Äæ½s¸¹ (±q 1 ¶}©l)¡A¦Ó²Ä¤G­Ó¤¸¯À¬°¨ä¤¤¤@­Ó XlColumnDataType ±`¼Æ¡A¥Î¥H«ü©w­åªRÄ檺¤è¦¡¡C
XlColumnDataType ±`¼Æ¥Nªí·N¸q
xlDMYFormat 4 DMY ¤é´Á®æ¦¡¡C
xlDYMFormat 7 DYM ¤é´Á®æ¦¡¡C
xlEMDFormat 10 EMD ¤é´Á®æ¦¡¡C
xlGeneralFormat 1 ¤@¯ë¡C
xlMDYFormat 3 MDY ¤é´Á®æ¦¡¡C
xlMYDFormat 6 MYD ¤é´Á®æ¦¡¡C
xlSkipColumn 9 ¤£­åªRÄæ¡C
xlTextFormat 2 ¤å¦r¡C
xlYDMFormat 8 YDM ¤é´Á®æ¦¡¡C
xlYMDFormat 5 YMD ¤é´Á®æ¦¡¡C
©Ò¥H²Ä¤@­Ó¤¸¯À¥iµø¬°¦Û¦ê°_©l¦ì¸m
²Ä¤G¤¸¯À¥Nªí¸ÓÄæ¦ìªº¸ê®Æ«¬ºA
¾Ç²ßVBA±q¿ý»s¥¨¶°¶}©l¡A¬O³Ì®e©ö¤W¤âªº¤è¦¡
µ{¦¡½X¬O¤@¥y§A¾Þ§@ªº°Ê§@¤@¤@ÂàĶ¦¨µ{¦¡½X
¦A¥[¤W§Q¥Î»¡©úÀÉ´N¯à²z¸Ñ¦U­Ó°Ñ¼Æªº¥Nªí·N¸q
­n¨ú±o»¡©ú¡A¥u­n±N¥Ñ¼Ð°±¯d¦bÃöÁä¦r¤W¡A«ö¤UF1´N¥i¨ú±o»¡©úÀÉ
±z¥i¹Á¸Õ¬Ý¬Ý
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

ÁÂÁª©¥D¹ï¾Ç²ßVba¨Ó»¡¥i¥H¤£²z·|²Ä¤G­Ó¤G¯Àªº·N¸q,¦ý¬O¨º·|¤@ºØ¹³没¦Y¹¡¶ºªº·Pı,ÁÙ¦³(F1)Keyªº¨Ï¥Î,¹ïªì¾ÇªÌ¨Ó»¡,¦³¤HÂI¯}¯u¦n,ÁÂÁª©¥D,¤j®a¥[ªo.
V98

TOP

        ÀR«ä¦Û¦b : ·O´d¨S¦³¼Ä¤H¡A´¼¼z¤£°_·Ð´o¡C
ªð¦^¦Cªí ¤W¤@¥DÃD