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

¥i¥H½Ð±Ð·íÄæ¦ì¤£¬O©T©w¦b¤@­Ó¦ì¸m§Ú­n¦p¦ócopy¨ì²Ä2¬¡­¶

¥i¥H½Ð±Ð·íÄæ¦ì¤£¬O©T©w¦b¤@­Ó¦ì¸m§Ú­n¦p¦ócopy¨ì²Ä2¬¡­¶

§Ú­Ì®aªº¸ê®Æ±`±`·|¤£¬O©T©wÄæ¦ì,§Ú¦³¥Îif ¥h§ì¥¦ªº¦ì¤l,¦ýµLªk¦^¶Ç¦ì¤l°T®§µ¹§Ú,©Ò¥H­n½Ð±Ð¤j¤j们,§Ú¥i¥H¥Î¦ó¤è¦¡§ì¨ú§Ú­nªºÄæ¦ì¦bcopy¨ì¥t¤@­Ó¬¡­¶Ã¯

test1.JPG (195.48 KB)

test1.JPG

test2.JPG (120.22 KB)

test2.JPG

Book1.rar (13.17 KB)

¦^´_ 1# hu0318s
  1. Sub ex()
  2. Dim A As Range
  3. With Sheet1
  4. Set A = .Cells.Find("¤u¥O", lookat:=xlWhole)
  5. If Not A Is Nothing Then A.CurrentRegion.Copy Sheet2.[A1]
  6. End With
  7. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

ÁÂÁ¤j¤j §ÚÁÙ¬O·s¤â©Ò¥H§Ú§â§Ú·Qªº¥´µ¹§A¬Ý¬Ý  
Dim A As Range    = ³]©w a ¬° ©Ò¦³Àx¦s®æ
With Sheet1       =³¯­z sheet1 ©Ò¦³°T®§
Set A = .Cells.Find("¤u¥O", lookat:=xlWhole)    = °}¦Ca = .Àx¦s®æ¤¤¸Óª«¥ó¥Nªí©Ò§ä¨ìªº²Ä¤@­Ó¥]§t©Ò´M§ä¸ê°TªºÀx¦s®æ(µ¥©ó"¤u¥O", µo²{­n§äªº¸ê®Æ=­n§å°t¨ì¸ê®Æ)
If Not A Is Nothing Then A.CurrentRegion.Copy Sheet2.[A1]  = ¦pªG not§ä¤£¨ì «ha´N¤£°õ¦æ §_«h a ´N¬O¨ì¦ì¸m°õ¦æctrl+a copy¨ì²Ä2¬¡­¶Ã¯
End With  =µ²§ô³¯­z
¤£ª¾§Úªº¤F¸Ñ¬O§_¦³»~

TOP

¦^´_ 3# hu0318s
  1. Sub ex()
  2. Dim A As Range   'DIM («Å§i¬°¨p¥ÎÅܼÆ) A  AS(«ü©wÅܼƫ¬ºA) Range '¥i°Ñ¦ÒVBA Range ÄÝ©Ê ªº»¡©ú
  3. With Sheet1      'With ³¯­z¦¡ ¦b¤@­Ó³æ¤@ª«¥ó©Î¤@­Ó¨Ï¥ÎªÌ¦Û­q«¬ºA¤W°õ¦æ¤@¨t¦Cªº³¯­z¦¡
  4.     Set A = .Cells.Find("¤u¥O", lookat:=xlWhole)
  5.     'a =>Range  .Àx¦s®æ¤¤¸Óª«¥ó¥Nªí©Ò§ä¨ìªº²Ä¤@­Ó¥]§t©Ò´M§ä¸ê°TªºÀx¦s®æ(µ¥....
  6.     If Not A Is Nothing Then A.CurrentRegion.Copy Sheet2.[A1]
  7.     'Not A Is Nothing :Not (ÅÞ¿è§_©w¡CªðÂà, ¤£¬O) A Is Nothing(A ¬O ªÅªºÅܼÆ) -> ¦³§ä¨ì
  8. End With
  9. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

³øºp­è¤U¯Z,ÁÂÁ¤j¤jªº±Ð¾É,§Ú¥i¥H¦b½Ð±Ð¤@¤U,¦pªG§Ú¥u­n¤u¥O¸ò«~¦W¶K¨ìsheet2 ,§Ú­è­è¦³¸Õ¹L
With Sheet1
Set A = .Cells.Find("¤u¥O", lookat:=xlWhole)
If Not A Is Nothing Then A.End(xlDown).Copy Sheet2.[A1]
Set A = .Cells.Find("«~¦W", lookat:=xlWhole)
If Not A Is Nothing Then A.End(xlDown).Copy Sheet2.[b1]
End With
End Sub
¬°¦óµLªkcopy "¤u¥O"¤U­±,¸ò"«~¦W"¥þ³¡, ¥¦¥ucopy ³Ìªñ¤@®æ¦³°T®§ªº¸ê®Æ¶K¨ìsheet2  ,³øºp¤S³Â·Ð¤j¤j们

TOP

§Ú¤]¨Ó½m²ß¤@¤U
  1. Sub ex2()
  2.     Dim A As Range
  3.     With Sheet1
  4.         Set A = .Cells.Find("¤u¥O", lookat:=xlWhole)
  5.         If Not A Is Nothing Then
  6.             Set t = A.CurrentRegion
  7.             t.Offset(0, 1).Resize(t.Rows.Count, 1).Copy Sheet3.[A1]
  8.             t.Offset(0, 3).Resize(t.Rows.Count, 1).Copy Sheet3.[B1]
  9.         End If
  10.     End With
  11. End Sub
½Æ»s¥N½X
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

¦^´_ 6# ML089


   ¤j¤j³øºp,§Ú­è­è¸Õ¹L¦ý¥¦¥u·|copy¥t¥ó®Æ¸¹,§Ú¦³¸Õ¹L§ï  t .Offset(0, 0).Resize(t.Rows.Count, 1).Copy Sheet3.[A1]  ,¥¦¥u·|copy"¤u¥O", ¦ý¦pªG­ncopy"«~¦W"´NµLªk·Ó§Ú­nªºcopy¨ìsheet3.[b2] ,½Ð°Ý§ÚÁÙ­n­×§ï¨ºÃä¤~·|Åý¹q¸£±a¥X§Ú«ü©wÄæ¦ì,·PÁ¤j¤j们ªºÀ°¦£

TOP

¦^´_ 7# hu0318s
½ÐªþÀÉ,¥i¤F¸Ñ§A©Ò»¡ªº°ÝÃD
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 8# GBKEE

±¡ªp¦pªG¬O³o¼Ë

12233.JPG (193.65 KB)

12233.JPG

122.JPG (178.38 KB)

122.JPG

Book1.rar (21.77 KB)

TOP

¦^´_ 9# hu0318s
  1. 'End ÄÝ©Ê ¶Ç¦^ Range ª«¥ó¡A¸Óª«¥ó¥Nªí¥]§t¨Ó·½½d³ò¤§°Ï°ìµ²§À³BªºÀx¦s®æ¡C
  2. 'µ¥©ó«ö END+¦V¤WÁä¡BEND+¦V¤UÁä¡BEND+¦V¥ªÁä©Î END+¦V¥kÁä¡C°ßŪ Range ª«¥ó¡C
  3. Sub Ex2()
  4.     Dim A As Range
  5.     With Sheet1
  6.         Set A = .Cells.Find("¤u¥O", lookat:=xlWhole)
  7.         If Not A Is Nothing Then
  8.              .Range(A, A.End(xlDown)).Copy Sheet3.[A1]
  9.         End If
  10.         Set A = .Cells.Find("«~¦W", lookat:=xlWhole)
  11.         If Not A Is Nothing Then
  12.              .Range(A, A.End(xlDown)).Copy Sheet3.[B1]
  13.         End If
  14.     End With
  15. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : Ä@­n¤j¡B§Ó­n°í¡B®ð­n¬X¡B¤ß­n²Ó¡C
ªð¦^¦Cªí ¤W¤@¥DÃD