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

°£¿ù

°£¿ù

¥»©«³Ì«á¥Ñ ÂŤÑÄR¦À ©ó 2018-10-31 11:08 ½s¿è

ª©¤W¦U¦ì¤j¤j¡A¤p§Ì­n­×§ï¤@­Ó¤§«eªºµ{¦¡¡A¦ý­×§ï«á¤´¦³¿ù»~¡A¯à½Ðª©¤W¤j¤jÀ°§Ú¬Ý¬Ý¶Ü??
%ÅÜ°Ê.rar (20.78 KB)

¥D­nªº¿ù»~¬O¤U¦Cªºµ{¦¡½X¡A·Ð½Ðª©¤W¤j¤jÀ°§Ú¬Ý¬Ý
.Offset(1).Cells(1, -1).Resize(, 1) = Rng.Cells(, -1).Resize(, 1).Value

³o­Óµ{¦¡ªº¥D­n¥\¯à¬O¨ä¼Æ­È¦³ÅÜ°Ê´N¬ö¿ý

¦^´_ 1# ÂŤÑÄR¦À
  1. .Offset(1).Cells(1, 1).Resize(, 1) = Rng.Cells(, 1).Resize(, 1).Value
½Æ»s¥N½X
©¹¤U¶ñ¼g?
Cells¨S¦³­t¼Æ¡C
»yªk
¹Bºâ¦¡ . Cells
¹Bºâ¦¡ ¥Nªí Worksheet ª«¥óªºÅܼơC

Offset¤~¦³­t¼Æ¡C
»yªk
¹Bºâ¦¡ . Offset( RowOffset, ColumnOffset )
RowOffset        ¿ï¥Î        Variant        ¸Ó½d³ò­n¦ì²¾ªº¦C¼Æ¡A¥i¬°¥¿­È¡B­t­È©Î 0 (¹s)¡C¥¿­Èªí¥Ü¦V¤U¦ì²¾¡A­t­Èªí¥Ü¦V¤W¦ì²¾¡C¹w³]­È¬° 0¡C
ColumnOffset        ¿ï¥Î        Variant        ¸Ó½d³ò­n¦ì²¾ªºÄæ¼Æ¡A¥i¬°¥¿­È¡B­t­È©Î 0 (¹s)¡C¥¿­Èªí¥Ü¦V¥k¦ì²¾¡A­t­Èªí¥Ü¦V¥ª¦ì²¾¡C¹w³]­È¬° 0¡C
¤@¤À§V¤O¡A¤@¤À¦¬Ã¬¡C
µo°ÝÃD«e¥i¥H¥ý·j¯Á¤º¤å¬O§_¦³¬ÛÃö½d¨Ò¡C

TOP

¥»©«³Ì«á¥Ñ n7822123 ©ó 2018-11-1 00:36 ½s¿è

¦^´_ 1# ÂŤÑÄR¦À

¦]¬°¹q¸£§ä¤£¨ì§A­nªºÀx¦s®æ!
.Offset(1).Cells(1, -1)=­ì¨ÓÀx¦s®æ¦V¤U¤@®æ¡A¦V¥ª2®æ

Á|¨Ò
[C2].Offset(1).Cells(1, -1).Select  '=A3

¦ý¬O·í­ì¨ÓÀx¦s®æ¦¡²Ä2Äæ®É¡A­nÅýµ{¦¡§ä¥ªÃä2Ä檺Àx¦s®æ¡A¹q¸£·|§ä¤£¨ì¡A´N·|¸õ¥X¿ù»~!
Á|¨Ò¦p¤U¡A§ä¤£¨ìBÄæ¦A©¹¥ª2Ä檺Äæ¦ì¡A©Ò¥Hµo¥Í¿ù»~
[B2].Offset(1).Cells(1, -1).Select '=?3

¦]¬°§Aªº¸ê®Æ±q²Ä2Äæ´N¦³¶}©l¦³­È¡A©Ò¥H".Offset(1).Cells(1, -1)"´N·|²£¥Í¿ù»~

ÁÙ¦³ÅÞ¿è¹Bºâ¬O±q«á­±©¹«eºâ
Á|¨Ò¨Ó»¡
MsgBox True Or False And False  '=MsgBox True Or (False And False)=True
¦Ó¤£¬O
MsgBox (True Or False) And False '=False

­Y¤£·Q·d²M·¡­þ­Ó¥ý¹Bºâªº¸Ü¡A³Ì¦n¥[¤W¬A©·¡A¤ñ¸û¤£·|¥X¿ù
­×§ï¦p¤U:
If (.Row = 2 Or .Row > 2) And .Value <> Rng.Value Then

.Row = 2 Or .Row > 2 ¥i²¤Æ¬°  .Row>=2

§Aªºµ{¦¡«Ü¦h¦a¤è¥i¥H²¤Æ
.Offset(1).Cells(1, -1).Resize(, 1) = Rng.Cells(, -1).Resize(, 1).Value
¤W¤@¦æµ¥®Ä©ó¤U¤@¦æ(¥u¦³¤@­ÓÀx¦s®æ¡A¤£»Ý­nResize)
.offset(1,-2)=Rng(,-1).value
µ{¦¡¬O¨Ì»Ý¨D¼gªº¡A»Ý¨Dªí¹F¤£²M·¡
©ÎªÌ¨S¦³¤W¶Çªþ¥ó¡A·R²ö¯à§U

TOP

¦^´_ 3# n7822123

For cts = 2 To 101
Set Rng = Cells(2, cts)
...
...

¸É¥R¡A§Aªºcts±q2¶}©l
©Ò¥H "Rng(, -1).Value"¡A­n§ä¨ì©¹¥ª¨âÄ檺­È¡A¤]¬O¤£¥i¯àªº
µ{¦¡¬O¨Ì»Ý¨D¼gªº¡A»Ý¨Dªí¹F¤£²M·¡
©ÎªÌ¨S¦³¤W¶Çªþ¥ó¡A·R²ö¯à§U

TOP

¦^´_ 2# faye59
©Ò¥HN¤j¡Aµ{¦¡½X§ï¦¨³o¼Ë´N¦æ¶Ü??
.Offset(1).Cells(1, 1).Resize(, 1) = Rng.Cells(, 1).Resize(, 1).Value

TOP

¥»©«³Ì«á¥Ñ ­ã´£³¡ªL ©ó 2018-11-1 10:51 ½s¿è

offset , cells ¥i¾Ü¤@¥Î, ¦P®É¨Ï¥Î¦h¦¹¤@Á|!!
cells(1,0) = ¦V¥ª²¾1®æ ---   ·í³B¤_AÄæ, µo¥Í¿ù»~
cells(1,-1) = ¦V¥ª²¾2®æ --- ·í³B¤_BÄæ, µo¥Í¿ù»~

offset(0,0) ¬Û·í¤_ cells(1,1),   ¨ä°Ñ¼Æ®t1

¨ú³æ¤@Àx¦s®æ, ¤£¶·¦A¥Îresize

TOP

¦^´_ 5# ÂŤÑÄR¦À


    ¥i¯à§A­n¥ý¬Ý¤@¤U¹Bºâ¦¡
³q±`§Ú¥u¥ÎCells©ÎRange³o¨â­Ó¥h§äÀx¦s®æ¦ì¸m
Offset§Ú·|¥Î©ó¶}ÀY®ÉªºÀx¦s®æ
¨Ò¦p:(°²³]AÄæ¦ì»PBÄæ¦ì²Ä¤@­Ó³£¦³­È)
  1. For Each A In Range("A:A")
  2. C = A.Offset(0,0).Value
  3. Next
½Æ»s¥N½X
  1. For Each A In Range("B:B")
  2. C = A.Offset(0,0).Value
  3. Next
½Æ»s¥N½X
²Ä¤@­ÓA:A
±o¥XªºC¦ì¸m¬°Range("A1")
²Ä¤G­ÓB:B
±o¥XªºC¦ì¸m¬°Range("B1")
¦³ª`·N¨ì¶Ü
©ú©ú³£¤@¼Ë¬OC = A.Offset(0,0).Value
¦ýµ²ªG«o¤£¤@¼Ë
Offset¬O¦³­t¼Æ­È±o
¦pªG¦A¥Î²Ä¤G­ÓB:B¥h±a
C = A.Offset(0,-1).Value
C³o®É­Ôªº¦ì¸mÅܦ¨Range("A1")

µM¦ÓCells¬O±q¾ã±i¬¡­¶Ã¯ªº¥ª¤W¨¤¶}©l­pºâ
´N¹³¼Æ¾ÇªºX»PY¶bÃö«Y
¤£ºÞ§A«ç»ò¼gCells(1,1)´N¬ORange("A1")
¤@¤À§V¤O¡A¤@¤À¦¬Ã¬¡C
µo°ÝÃD«e¥i¥H¥ý·j¯Á¤º¤å¬O§_¦³¬ÛÃö½d¨Ò¡C

TOP

¦^´_ 7# faye59


³æ¿WCells(?,?), ¬O¥H¤u§@ªí¬°·Ç(¥HA1¬°°_©l,¦V¥k©Î¦V¤U°¾²¾), ©Ò¥H[­t¼Æ]©Î[0]¤£¥i¥Î,
Range("H8").cells(?, ?) , «h¥i¥HH8¬°¤¤¤ß, ¤W¤U¥ª¥k°¾²¾~~¥¿¼Æ/­t¼Æ/0¬Ò¥i¥Î, ¥u­n¤£¶W¥X¤u§@ªí½d³ò~~

TOP

¦^´_ 8# ­ã´£³¡ªL


    ÁÂÁ­ã¤j´£¿ô!

¦^´_ 1# ÂŤÑÄR¦À
µM¦ÓCells¬O±q¾ã±i¬¡­¶Ã¯ªº¥ª¤W¨¤¶}©l­pºâ
´N¹³¼Æ¾ÇªºX»PY¶bÃö«Y
¤£ºÞ§A«ç»ò¼gCells(1,1)´N¬ORange("A1")

³o¥y¸Ü»Ý­n°µ§ó¥¿
§Ú·Qªí¹Fªº¬O°_©l¦ì¸m
¦ý¥Î¿ù»¡ªk
Cells¨Ã«Dµ´¹ï¦ì¸m
¤@¤À§V¤O¡A¤@¤À¦¬Ã¬¡C
µo°ÝÃD«e¥i¥H¥ý·j¯Á¤º¤å¬O§_¦³¬ÛÃö½d¨Ò¡C

TOP

¥»©«³Ì«á¥Ñ n7822123 ©ó 2018-11-5 02:56 ½s¿è

¦^´_ 9# faye59



«y«y......¨ä¹ê§Ú¤]¦³¦a¤è¨SÁ¿²M·¡¡A
¬°¤FÁקK»~¾É§O¤H¡A§ÚÁÙ¬O¦Û§ÚªÈ¥¿¤@¤U¡A
ÅÞ¿è¹Bºâ¬O±q«á­±©¹«eºâ
³o¥y¸Ü¥u¦³For¸Ó¹Bºâ¦¡
¹ê»Ú¤W¬O "And" ·|¤ñ "Or" ¥ýºâ
©Ò¥H¸Ó¦¡·|Åܦ¨«á­±ªº¥ýºâ
¦pªG·Q­nOr¥ýºâ¡A»Ý­n¥[¤W¬A©·
¬Ý¤F¤U¹Ï´N©úÁA¤F

µ{¦¡¬O¨Ì»Ý¨D¼gªº¡A»Ý¨Dªí¹F¤£²M·¡
©ÎªÌ¨S¦³¤W¶Çªþ¥ó¡A·R²ö¯à§U

TOP

        ÀR«ä¦Û¦b : ¹D¼w¬O´£ª@¦Û§Úªº©ú¿O¡A¤£¸Ó¬O¨þ¥¸§O¤HªºÃ@¤l¡C
ªð¦^¦Cªí ¤W¤@¥DÃD