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

[µo°Ý] VBA¡A¦h­Ó¤u§@ªí¡A¦P¨B§R°£«ü©w±ø¥ó¦C

[µo°Ý] VBA¡A¦h­Ó¤u§@ªí¡A¦P¨B§R°£«ü©w±ø¥ó¦C

¦U¦ì¤j¤j
¤p§Ì¦³­Ó¨T¨®¥æ©öªºÂ²©öÀÉ

Sheet1¤ÎSheet2¬O¬ÛÃöªº
¦]¬°Sheet1·|¦^¶ÇSheet2ªº¸ê®Æ
©Ò¥H§Æ±æSheet1 ¬Y¤ÞÀº¸¹½X¦C³Q§R°£®É
Sheet2 ¦P¼Ëªº¤ÞÀº¸¹½X¦C¡A¤]³£¦P¨B¾ã¦C§R°£

¨Ò¦p
Sheet1 D10Àx¦s®æ ¤ÞÀº¸¹½XABC1234
Sheet2 B13Àx¦s®æ ¤ÞÀº¸¹½X¤]¬OABC1234
¨º§Ú¦bSheet1§R°£²Ä10¦C¾ã¦C®É
Sheet2 ²Ä13¦C¤]¦P¨B¾ã¦C§R°£

§ä¤F2¤Ñ¡A­w¤F«Ü¦h¤å¡A³£§ä¤£¨ì³o­Ó¤èªk
§Æ±æ¦³¦n¤ßªº¤j¤j¯àÀ°À°§Ú
·P®¦¡@

¦^´_ 1# dennis
¸Õ¸Õ¬Ý
  1. Option Explicit
  2. Sub Ex()
  3.     Dim Rng As Range, Sh As Worksheet
  4.     For Each Sh In Sheets  'Sheets:¤u§@ªí¶°¦Xª«¥ó
  5.         Do
  6.             Set Rng = Sh.Cells.Find("ABC1234", Lookat:=xlWhole)
  7.             If Not Rng Is Nothing Then
  8.                 Rng.EntireRow.Delete
  9.                 Set Rng = Sh.Cells.Find("ABC1234", Lookat:=xlWhole)
  10.             End If
  11.         Loop Until Rng Is Nothing
  12.     Next
  13. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

GBKEE¤j¤j¡G
               «D±`·PÁ±zªº¦^´_¡A¤£¹L¦³2­Ó¤p°ÝÃD
               1.¦bsheet1¬O§¹¥þªº¾ã¦C§R°£¨S¿ù¡A¦ý¦bsheet2«o¥u¬O§R°£¸ÓÀx¦s®æ¡A¨S¿ìªk§¹¥þªº¾ã¦C§R°£
               2.·Q½Ð°Ý¬O§_¥i¥H¡A¨Ï¥Î¹ï¸Üµøµ¡¨Ó°õ¦æ§R°£«ü¥O
               ³Â·Ð±z¤F¡A«D±`·PÁÂ

TOP

³Â·Ð±z¤F
ÁÂÁÂ


    ¨T¨®¥æ©ö©ú²Ó.rar (26.46 KB)

TOP

¦^´_ 4# dennis
¬O³o¼Ë¶Ü?
  1. Sub Ex()
  2.     Dim Rng As Range, i As Integer
  3.     Set Rng = Sheets(1).Cells.Find("64631325", Lookat:=xlWhole) '²Ä1±i¤u§@ªí¤¤´M§ä¤ÞÀº¸¹½X
  4.     If Not Rng Is Nothing Then
  5.             Rng.EntireRow.Delete
  6.         For i = 2 To Sheets.Count '²Ä2±i¤u§@ªí¨ì³Ì«á¤@±i¤u§@ªí
  7.             Sheets(i).Cells.SpecialCells(xlCellTypeFormulas, xlErrors).EntireRow.Delete
  8.         Next
  9.     End If
  10. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

[ª©¥DºÞ²z¯d¨¥]
  • GBKEE(2014/6/1 17:32): ½Ð¦bªþÀɬݬÝ

GBKEE¤j¤j¡G
­º¥ý«D±`·PÁ±zªºÀ°§U:lol :lol :lol
¤£¦n·N«ä
¤£ª¾¹D¬O¤£¬O§Ú¤£·|¨Ï¥Î¡A¦]¬°ÁÙ¬O¤@¼Ë
§Ú¬O§â±z¼gªºVBA½X
¤À§O½Æ»s¨ìsheet1¤ÎThisworkbook¡A¦ý³£¤@¼Ë
¦bsheet1¬O§¹¥þªº¾ã¦C§R°£¨S¿ù¡A¦ý¦bsheet2«o¥u¬O§R°£¸ÓÀx¦s®æ¡A¨S¿ìªk§¹¥þªº¾ã¦C§R°£
:dizzy: :dizzy:

TOP

        ÀR«ä¦Û¦b : ¥@¤W¦³¨â¥ó¨Æ¤£¯àµ¥¡G¤@¡B§µ¶¶ ¤G¡B¦æµ½¡C
ªð¦^¦Cªí ¤W¤@¥DÃD