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

[µo°Ý] ¦p¦ó¥Ñ³Ì«á¤@¦C¼Æ°_¥h½Æ»s«ü©w¼Æ¶q

[µo°Ý] ¦p¦ó¥Ñ³Ì«á¤@¦C¼Æ°_¥h½Æ»s«ü©w¼Æ¶q

¦U¦ì¤j¤j

1.sheet1ªíªºF:GÄ欰¸ê®Æ°Ï¬ù100¸ê®Æ¦C(¼Æ¶q¤£©w),    K:LÄ欰¸ê®Æ¿é¥X°Ï
2.[B2]Àx¦s®æ¬°«þ¨©¼Æ¶q, ·í[B2]=±`¼Æ®É, ¬O§_¯à±q   F:GÄæ³Ì«á¤@¦C¥Ñ¤U©¹¤W¼Æ¨ú³o­Ó°Ï¶ôªºÀx¦s®æ¸ê
  ®Æ¨ÃCopy¦ÜK:LÄæ.

¨Ò¦p:[B2]=3, F:GÄ榳11­Ó¸ê®Æ¦C(F1:G11). ·í«ö¤U«ö¶s¬O§_¥i¥H¥Ñ¤U©¹¤W¦@½Æ»s3­Ó°Ï¶ô¸ê®Æ§YF9:G11¦ÜK1Àx¦s®æ¦pªþÀÉ»¡©ú.
¦P²z: ­Y[B2]=5´N½Æ»sF7:G11¦@5µ§¸ê®Æ¦C¦ÜK1Àx¦s®æ   ¾l¦¹Ãþ±À....
 
VBA¦p¦ó¼g¥X¨Ó?
copy.rar (15.36 KB)

¥»©«³Ì«á¥Ñ stillfish00 ©ó 2013-5-8 03:44 ½s¿è

¦^´_ 1# luke
  1. Sub TEST()
  2. Dim r As Long
  3. With Sheets("sheet1")
  4.   .[K:L].ClearContents
  5.   r = Application.Max(.Cells(.Rows.Count, "F").End(xlUp).Row, .Cells(.Rows.Count, "G").End(xlUp).Row)
  6.   .[K1].Resize(.[B2], 2) = .Cells(r - .[B2] + 1, "F").Resize(.[B2], 2).Value
  7. End With
  8. End Sub
½Æ»s¥N½X

TOP

¦^´_ 2# stillfish00

    °õ¦æOK
    ÁÂÁÂstillfish00
   
¥H¤W

TOP

¦^´_ 2# stillfish00
¼Ó¥D¦³»¡: ·í[B2]=±`¼Æ®É ­n¦³°£¿ù
  1. Option Explicit
  2. Sub Ex()
  3.     With Sheets("Sheet1")
  4.         If .[B2] > 0 And .[B2] <= Application.CountA(.[F:F]) Then
  5.             .[K:L] = ""
  6.              .[K1].Resize(.[B2], 2) = .Range("F" & .Rows.Count).End(xlUp).Offset(1 - .[B2]).Resize(.[B2], 2).Value
  7.             
  8.              '.Range("F" & .Rows.Count).End(xlUp).Offset(1 - .[B2]).Resize(.[B2], 2).Copy .[K1]     '½Æ»s
  9.             
  10.         Else
  11.             MsgBox "B2 ¦³»~"
  12.         End If
  13.     End With
  14. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 4# GBKEE
¬Oªº¡A·PÁ­ץ¿¡C

TOP

        ÀR«ä¦Û¦b : ¦n¨Æ­n´£±o°_¡A¬O«D­n©ñ±o¤U¡A¦¨´N§O¤H§Y¬O¦¨´N¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD