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

[µo°Ý] ¦¹µ{§Ç¦p¦ó­×§ï?

[µo°Ý] ¦¹µ{§Ç¦p¦ó­×§ï?

¥»©«³Ì«á¥Ñ t8899 ©ó 2014-4-28 07:37 ½s¿è

§Ú·Q§äAÄæ ­Ë¼Æ²Ä¤@­Ó¤p©ó TimeValue("12:48:20")  ¥k²¾¤@®æ(BÄæ)
¦A²Î­pB1¨ì¦¹®æªº¦X­p
©Î¦³§ó¦nªº¼gªk??
Book2.rar (7.67 KB)

Sub aaa()
Dim x As Date
x = TimeValue("12:48:20")
For k = 1 To 165 Step -1
If Cells(k, 1) < x Then
Set t = Cells(k, 1).Offset(0, 1)
t.Offset(t, t, 0, -counta(range("b26:"& t), 1).Select
Exit For
End If
Next
End Sub

¥»©«³Ì«á¥Ñ GBKEE ©ó 2014-4-28 20:26 ½s¿è

¦^´_ 1# t8899
¤u§@ªí¨ç¼Æ  OFFSET(reference,rows,cols,height,width)  (¤u§@ªí¤Wªº¨ç¼Æ¤½¦¡)
Reference    ¬O­Ó°Ñ·Ó¦ì§}¡A¥¦¬O±z¥Î¥H­pºâ¦ì²¾µ²ªGªº°_©l¦ì¸m¡CReference ¥²¶·°Ñ·Ó¨ì¬Û¾F¿ï¨ú½d³òªº¤@­ÓÀx¦s®æ©Î½d³ò¡A§_«h OFFSET ¨ç¼Æ¶Ç¦^¿ù»~­È #VALUE!¡C
Rows    ¬O¥Î¥H«ü¥Ü¥ª¤W¨¤Àx¦s®æ­n««ª½ (©¹¤W©Î©¹¤U) ²¾°Êªº¦C¼Æ¡C¨Ò¦p¡Arows ­È¬° 5¡A·N«ü©Ò¶Ç¦^¤§°Ñ·Ó¦ì§}¤§¥ª¤W¨¤Àx¦s®æ¦ì§}¤ñ reference ¤Þ¼Æ§C¤­¦C¡C¦¹¤Þ¼Æ¥i¥H¬O¥¿¼Æ (ªí¥Ü¦b°_©l°Ñ·Ó¦ì§}¤U¤è) ©Î­t¼Æ (ªí¥Ü¦b°_©l°Ñ·Ó¦ì§}¤W¤è)¡C
Cols    ¬O¥Î¥H«ü¥Ü¥ª¤W¨¤Àx¦s®æ­n¤ô¥­ (©¹¥ª©Î©¹¥k) ²¾°ÊªºÄæ¼Æ¡C¨Ò¦p¡Acols ­È¬° 5¡A·N«ü©Ò¶Ç¦^¤§°Ñ·Ó¦ì§}¤§¥ª¤W¨¤Àx¦s®æ¦ì§}¦b reference ¤Þ¼Æ¥k¤èªº²Ä¤­Äæ¤W¡C¦¹¤Þ¼Æ¥i¥H¬O¥¿¼Æ (ªí¥Ü¦b°_©l°Ñ·Ó¦ì§}¥k¤è) ©Î­t¼Æ (ªí¥Ü¦b°_©l°Ñ·Ó¦ì§}¥ª¤è)¡C
Height    ¬O³]©w¶Ç¦^ªº°Ñ·Ó¦ì§}À³¥]¬AªºÀx¦s®æ°ª«× (Àx¦s®æ½d³òªº¦C¼Æ) ªº¼Æ­È¡C¦¹¤Þ¼Æ¥²¶·¬O¥¿¼Æ¡C
Width    ¬O³]©w¶Ç¦^ªº°Ñ·Ó¦ì§}À³¥]¬AªºÀx¦s®æ¼e«× (Àx¦s®æ½d³òªºÄæ¼Æ) ªº¼Æ­È¡C¦¹¤Þ¼Æ¥²¶·¬O¥¿¼Æ¡C
****************************************************************************
VBA Offset ÄÝ©Ê  (VBA ¤Wªºµ{¦¡½X)
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
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_  t8899
¤u§@ªí¨ç¼Æ  OFFSET(reference,rows,cols,height,width)  (¤u§@ªí¤Wªº¨ç¼Æ¤½¦¡)
Reference ...
GBKEE µoªí©ó 2014-4-28 20:24


§Ú§â¤u§@ªí¤Wªº¨ç¼Æ¤½¦¡,¸òVBA ²V¦b¤@°_¤F!:(

TOP

        ÀR«ä¦Û¦b : µêªÅ¦³ºÉ¡D§ÚÄ@µL½a¡AµoÄ@®e©ö¦æÄ@Ãø¡C
ªð¦^¦Cªí ¤W¤@¥DÃD