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

[µo°Ý] ¨S¦³³]©wª«¥óÅܼƩΠWith °Ï¶ôÅܼÆ

¥»©«³Ì«á¥Ñ stillfish00 ©ó 2014-6-9 13:39 ½s¿è

¦^´_ 3# esperanto
»¡©ú½d¨Òªºbug§a¡A§Ú·|§â
  1. Loop While Not c Is Nothing And c.Address <> firstAddress
½Æ»s¥N½X
§ï¦¨
  1.     If c Is Nothing Then Exit Do
  2. Loop While c.Address <> FirstAddress
½Æ»s¥N½X
­ì¦]À³¸Ó¬Oloop while ±ø¥ó¤¤¡A
VBA·|§â¨â±ø¥ó¥ý¨D¥X¨Ó¦AAnd°_¨Ó¡A³y¦¨
c.Address <> FirstAddress¥ª¦¡¦bc¬°nothing®É¨D¤£¥X¨Ó¡C

TOP

¦^´_ 5# esperanto
À³¸Ó¬O§A¦b§Oªºµ{¦¡¡A¦b§ä¨ìc«á¤£·|§ï±¼cªº­È¡A©Ò¥Hloop¤¤¤£·|¦³c¬°nothing(§ä¤£¨ì¤U¤@­Ó)ªº°ÝÃD¡C
¦ÓVBA»¡©ú½d¨Ò
  1. With Worksheets(1).Range("a1:a500")
  2.     Set c = .Find(2, LookIn:=xlValues)
  3.     If Not c Is Nothing Then
  4.         FirstAddress = c.Address
  5.         Do
  6.             c.Value = 5
  7.             Set c = .FindNext(c)
  8.         Loop While Not c Is Nothing And c.Address <> FirstAddress
  9.     End If
  10.   End With
½Æ»s¥N½X
»¡©ú½d¨Ò¦³c.value = 5 ¡A2³£§ï¬°5«á´N§ä¤£¨ì2¤F
¦Ó§Aªº¨Ò¤l¡A¦³Range(Worksheets("Scheduling").Cells(c.Row, 1), Worksheets("Scheduling").Cells(c.Row + 1, 9)).ClearContents
·|§â§A§äªºmachine²M±¼¡A©Ò¥HFindNext³Ì«á·|¶Ç¦^Nothing

TOP

        ÀR«ä¦Û¦b : ¦³Ä@©ñ¦b¤ß¸Ì¡A¨S¦³¨­Åé¤O¦æ¡A¥¿¦p¯Ñ¥Ð¤£¼½ºØ¡A¬Ò¬OªÅ¹L¦]½t¡C
ªð¦^¦Cªí ¤W¤@¥DÃD