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

[µo°Ý]½Ð°Ý¿é¥X¦¨.TXTÀɮɥi¥H«ü©w¦bTXTÀɤ¤ªº¦ì¸m¶Ü?

¦^´_ 10# asus103
µ{¦¡½X¤¤³\¦h¨Æ¨Ã¤£©ú¥Õ¡AÁٽЫü±Ð
1.For Each A In [A1:D1]
  ad = Range(A, Cells(Cells.Rows.Count, A.Column).End(xlUp)).Address
  ad¤£¬OA1:D11¶Ü?¬°¦ó¨C¤@¦¸²¾°Ê¤@Äæ¦Ó¤£¬O¤@­ÓÀx¦s®æ
ans:§Ú¨Ï¥Î²Ä¤@¦C§@°j°é¡A©Ò¥Had¦r¦ê¬O¶Ç¦^¸Ó¦C¸ê®Æ½d³òªº¦ì§}

2.Ar(s) = Evaluate("MAX(LENb(" & ad & "))")
   ·Pı¤W¹³EXCEL¤¤°}¦Cªº¥Îªk¡A¦ý¹ê¦b´x´¤¤£¦í¬ªù©Ò¦b¡A¯à¸ÑÄÀ¤@¤U³o­Ó¥Îªk¶Ü?
ans:³o¬O°}¦C¥Îªk¨S¿ù¡A³oµ¥©ó¦bÀx¦s®æ¤º¶ñ¤J°}¦C¤½¦¡¡A°²³]adÅܼƪº­Èµ¥©ó"$A$1:$A$11"
´Nµ¥¦P¦bÀx¦s®æ¤º¿é¤J°}¦C¤½¦¡{=MAX(LENB($A$1:$A$11))}©Ò±o¨ìªº­È¤@¼Ë

3.Evaluate("LenB(""" & test & """)") ªº¥Îªk¤]¬Ý¤£À´
  §Ú§â¥¦§ï¦¨ LenB( test) «á³v¦æ°õ¦æ®ÉÁÙOK¡A¦ý³Ì«á¦ü¥GÅܦ¨µL½u°j°é¸õ¤£¥X¨Ó
  Evaluate()¤w¤j¤jªº¥Îªk¦ü¥G¥Nªí¨ç¼Æ¬O¶Ü?¦ý»¡©ú¤¤¥u¦³¥¦¬O"¤èªk"ªº¥Îªk
4.§Ú¥Îlenb()¦bµ{¦¡¤¤±o¨ìªº²Ä2Äæ³Ì¤j­È¬°26¡A¬°¦ó¤j¤j¯à±o¥¿½Tªº22
ans3¡B4:Evaluate¦WºÙÂà´«¦¨ª«¥ó©ÎªÌ­È
©Ò¥H¥L´N¬O¤@­Óª«¥ó¥]¸Ë¤èªk¡A±N¦r¦ê´y­zÂà´«¦¨±Ô­z©Ò±o¤§­È
³oÃä­È±oª`·Nªº¬OvbaªºLENB¨ç¼Æ¸ò¤u§@ªí¨ç¼ÆLENB¦³©Ò®t²§
¨Ï¥ÎEvaluate¤èªk¤¤µ¥¦P¬O¤u§@ªí¨ç¼Æ¹Bºâ
¤u§@ªí¨ç¼ÆLENB·|¨Ì·Ó¨C­Ó¦rªº¦ì¤¸¼Æ­pºâ
vbaªºLENB¨ç¼Æ«h¨C­Ó¦r¤¸³£µø¬°2­Ó¦ì¤¸
¦¹®t²§©Ê½Ð°Ñ¾\VBAªºLENB½d¨Ò»¡©ú
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¥»©«³Ì«á¥Ñ asus103 ©ó 2011-1-19 16:52 ½s¿è

¦^´_ 11# Hsieh
·PÁÂHsieh¤j¤jªº¸Ñ»¡
§Ú¥i¥HÄ~Äò½Ð±Ð¶Ü?

1.For Each A In [A1:D1]
  ad = Range(A, Cells(Cells.Rows.Count, A.Column).End(xlUp)).Address
  ad¤£¬OA1:D11¶Ü?¬°¦ó¨C¤@¦¸²¾°Ê¤@Äæ¦Ó¤£¬O¤@­ÓÀx¦s®æ
ans:§Ú¨Ï¥Î²Ä¤@¦C§@°j°é¡A©Ò¥Had¦r¦ê¬O¶Ç¦^¸Ó¦C¸ê®Æ½d³òªº¦ì§}
¤£¦n·N«ä¡A§ÚÁÙ¬O¤£À´¬O¦p¦ó§i¶DVBA¬O¦C§@°j°éªº
2.Ar(s) = Evaluate("MAX(LENb(" & ad & "))")
¤W¦¡¤§©Ò¥H¬O°}¦C¤½¦¡¬O¦]¬°" & ad & "ÁÙ¬O Evaluate
´«¨¥¤§¡A­Y­n¦bVBA¤¤¨Ï¥Î°}¦C¤½¦¡­nª`·N¬Æ»ò
¦pªG»¡¡G
°}¦C¤½¦¡¤¤ªº{}¥ÎEvaluate()¨ú¥N¡AEXCELªº¨ç¼Æ©Ò»Ý¤Þ¼Æ©ñ¤J¦r¦ê¤¤¨Ã¥Î" &     & "¨Ó±a¤J
³o¼Ë¹ï¶Ü?

3.Evaluateªº¥Îªk§ÚÁÙ¶·¦h¥[µZ¿i¡A¥u¬O
"¨Ï¥ÎEvaluate¤èªk¤¤µ¥¦P¬O¤u§@ªí¨ç¼Æ¹Bºâ"¬°¦ó¤£¬O¨Ï¥Îapplication.---
¨ä¹ê§Ú¤]¸Õ¹L¥Îapplication.LenB()¥u¬O½sĶ¶¥¬q´N¥X¿ù¤F


¤£¦n·N«ä¡AÄ~Äò§ä±z³Â·Ð
¦pªG¦³¨ä¥L¦a¤è¦³Evaluateªº¥Îªk©Î¬OVBA¤¤¨Ï¥Î°}¦C¤½¦¡ªº¨Ï¥Î»¡©ú
·Ð½Ð§iª¾¡A§Ú·|¦A¦h¥[§V¤Oªº
ASUS

TOP

¦^´_ 12# asus103


    For Each A in [A1:D1]
©Ò¥HÅܼÆA¨Ì§Ç¬°A1,B1,C1,D1
adÅܼƬOÅܼÆA¨ìA©Ò¦bÄæ¦ì¸ê®Æ§À½d³òªº¦ì§}¦r¦ê
·íA=[A1]®É¡Aad="$A$1:$A$11"
·íA=[B1]®É¡Aad="$B$1:$B$11"
¥H¦¹Ãþ±À

Evaluate´N¬O­pºâ¬A¸¹¤º¦r¦ê±Ô­z
¦]¬°LEN¨ç¼Æ¦P®É¬°¤u§@ªí¨ç¼Æ»PVBA¨ç¼Æ¡A©Ò¥H¨Ï¥ÎworksheetfunctionµLªk¥¿½T¤Þ¥Î¡A·|¥X¿ù¡A¬G±Ä¥ÎEvaluate
¦Ü©ó¬O¬°¦ó¯à¹F¨ì°}¦C­pºâ®ÄªG¡AºÝ¿à¬A¸¹¤º¦r¦ê±Ô­z¡A«DEvaluate©Ò­P¡AEvaluate¤èªk·|¨Ì·Ó´y­z¹Bºâ¡A©Ò¥H¦¹¨Ò¬O¦]¬°ad¦r¦ê¬O¥Nªí¤@­Ó½d³ò¡A©Ò¥H·|¦³°}¦C®ÄªG²£¥Í

Evaluate¦b»¡©ú¤¤¤w¸g©ú¥Õ«ü¥X¡A¦¹¤èªk¬O§â¦WºÙÂà´«¦¨ª«¥ó©ÎªÌ­È
©Ò¿×¦WºÙ´N¬O¦r¦ê±Ô­z
­«ÂI¬O¦r¦ê±Ô­z¦Ó¤£¬OEvaluateªº¸ÑÄÀ¡AEvaluate´N¹³¬O­Ó¨ç¼Æ¦WºÙ
¨º»ò¥¦ªº¥\¥Î´N¬O§â¦r¦ê±Ô­zÂন¹Bºâ¡A¦p¦¹¦Ó¤w¡C
­YÁÙ¤£©ú¥Õ¡A§Ú´N¤£ª¾¸Ó¦p¦ó¸ÑÄÀ¤F¡C½Ð¹ïEvaluate¦³§ó²`»{ÃѪº«e½úÀ°¦£¸ÑÄÀ§a
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 13# Hsieh
·PÁÂHsieh¤j¤j
§Ú¤j·§¦³¤C¡B¤K¦¨À´¤F
§Ú·|¸ÕµÛ¥Î³o¨Ç·§©À¨Ó¼g¤@­Ó¨ç¼Æ¡A¤w¹ý©³¤F¸Ñ¨ä¥Îªk
·PÁ±z
³o¯u¬O­ÓÂצ¬ªº¤@¤Ñ
ASUS

TOP

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