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

[µo°Ý] ¦³Ãö¸ê®Æ­åªR

¦^´_ 10# freeffly
VBA ªº»¡©ú
Split ¨ç¼Æ ¶Ç¦^¤@­Ó³¯¦C¯Á¤Þ±q¹s¶}©lªº¤@ºû°}¦C¡A¥¦¥]§t«ü©w¼Æ¥Øªº¤l¦r¦ê¡C
»yªk
Split(expression[, delimiter[, limit[, compare]]])
Split ¨ç¼Æ»yªk¦³¦p¤U´X­Ó«ü¦W¤Þ¼Æ¡G ½Ð¬d¬ÝVBA ªº»¡©ú

Offset ÄÝ©Ê   ¶Ç¦^ Range ª«¥ó¡A¥Î¥H¥Nªí¬Y­Ó«ü©w°Ï°ì¥H¥~ªº½d³ò¡C°ßŪ¡C
expression.Offset(RowOffset, ColumnOffset)
expression     ¥²¿ï¡C¸Ó¹Bºâ¦¡¶Ç¦^ Range ª«¥ó¡C
RowOffset      ¿ï¾Ü©Êªº Variant¡C¥Î¦C¼Æªí¥Üªº°Ï°ì¦ì²¾ (¥¿­È¡B­t¼Æ©Î¹s (0))¡C¥¿­Èªí¥Ü¦V¤U¦ì²¾¡A­t­Èªí¥Ü¦V¤W¦ì²¾¡C¹w³]­È¬° 0¡C
ColumnOffset      ¿ï¾Ü©Êªº Variant¡C¥ÎÄæ¼Æªí¥Üªº°Ï°ì¦ì²¾ (¾ã¼Æ¡B­t¼Æ©Î 0 (¹s))¡C¥¿­Èªí¥Ü¥k¦ì²¾¡A­t­Èªí¥Ü¥ª¡C¹w³]­È¬° 0¡C
  1. Option Explicit
  2. Sub Ex()  '±N¦r¦ê¤À³Î¦¨¤l¦r¦ê
  3.     Dim A As Range
  4.     'SpecialCells ¤èªk ¦¹ª«¥ó¥Nªí»P«ü©w«¬ºA¤Î­È¬Û²Å¦Xªº©Ò¦³Àx¦s®æ¡CRange ª«¥ó¡C
  5.     For Each A In Range("A:A").SpecialCells(xlCellTypeConstants) 'xlCellTypeConstants¡C¥]§t±`¼ÆªºÀx¦s®æ
  6.         'If IsDate(A) Then     '¬O¤é´Á«¬ºA
  7.         If InStr(A, "/") Then  '¦r¦ê¤¤¦³ "/"
  8.         'InStr ¨ç¼Æ ¶Ç¦^¦b¬Y¦r¦ê¤¤¤@¦r¦êªº³Ì¥ý¥X²{¦ì¸m¡A¦¹¦ì¸m¬° Variant (Long)¡C
  9.             With A.Offset(, 1).Resize(, 3)
  10.             '¥HA.Offset(, 1):[BÄæ],Resize(, 3):ÂX¥R3Ä檺Range½d³ò
  11.                 .Value = Split(A, "/")   '¥H "/" ¤À³Î¦r¦ê
  12.                 .Value = .Value          'Åܧ󬰼Ʀr
  13.             End With
  14.            'Split ¨ç¼Æ ¶Ç¦^¤@­Ó³¯¦C¯Á¤Þ±q¹s¶}©lªº¤@ºû°}¦C , ¥¦¥]§t«ü©w¼Æ¥Øªº¤l¦r¦ê
  15.         End If
  16.     Next
  17. End Sub
½Æ»s¥N½X

TOP

¦^´_ 11# GBKEE


    ÁÂÁª©¥D¸ÑÄÀ
   ¦n¹³ÁÙ­nªáÂI®É¶¡²z¸Ñ
  ¥ý¦¬¤U¨ÓºCºC«~À|¤@¤U
¦r¨å¨â¦U¦r ÁÙ¯uÃø²z¸Ñ

TOP

        ÀR«ä¦Û¦b : ¤@­Ó¤Hªº§Ö¼Ö¡D¤£¬O¦]¬°¥L¾Ö¦³±o¦h¡A¦Ó¬O¦]¬°¥L­p¸û±o¤Ö¡C
ªð¦^¦Cªí ¤W¤@¥DÃD