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

½Ð°ÝVBA´M§ä¨Ï¥Î¤èªk

½Ð°ÝVBA´M§ä¨Ï¥Î¤èªk

·Q½Ð°Ý¤@¤U ¦p¦ó¨Ï¥Î¦h­«±ø¥ó´M§ä  ¦pªþÀÉ

±ø¥ó¦¡ AÄæ©MBÄæ³£²Å¦X ¤~§âCÄõªºª½§ì¶i¨Ó

³o¼Ëªº¸Ü¤]¥i¥H¥ÎVooklup ©Î¬O find ¶Ü?

sheet1.rar (7.2 KB)

¸ê®Æªí

GinBow

¥»©«³Ì«á¥Ñ register313 ©ó 2012-5-26 14:05 ½s¿è

¦^´_ 1# ginbow
  1. Sub xx()
  2. Dim AR()
  3. I = 1
  4. For Each A In Range("A2:A" & [A2].End(xlDown).Row)
  5.   ReDim Preserve AR(1 To I)
  6.   If A = "2011/12/7" And A.Offset(0, 1) = 3 Then
  7.      AR(I) = A.Offset(0, 2)
  8.      I = I + 1
  9.   End If
  10. Next
  11. [E1].Resize(UBound(AR), 1) = Application.Transpose(AR)
  12. End Sub
½Æ»s¥N½X
  1. Sub bb()
  2. Set Rng = Range("A1:C" & Range("A65536").End(xlUp).Row)
  3. Rng.AutoFilter Field:=1, Criteria1:=DateValue("2011/12/7")
  4. Rng.AutoFilter Field:=2, Criteria1:=3
  5. Rng.Offset(0, 2).Resize(, 1).SpecialCells(xlCellTypeVisible).Copy [E1]
  6. Rng.AutoFilter
  7. End Sub
½Æ»s¥N½X
  1. Sub cc()
  2. [E:E] = ""
  3. Set Rng = [A:A].Find(DateValue("2011/12/7"), , , xlWhole)
  4. If Not Rng Is Nothing Then
  5.    S = Rng.Address
  6.    Do
  7.      If Rng.Offset(0, 1) = 3 Then [E65536].End(xlUp).Offset(1, 0) = Rng.Offset(0, 2)
  8.      Set Rng = [A:A].FindNext(Rng)
  9.    Loop While Not Rng Is Nothing And Rng.Address <> S
  10. End If
  11. End Sub
½Æ»s¥N½X

TOP

ÁÂÁ §Úµy·L§ï¤F¤@¤U ¥i¬O¤£ª¾¹D¬°¤°»ò§ì¤£¨ì

¥i¥HÀ°§Ú¬Ý¤@¤U­þ¸Ì¥X¿ù¶Ü ÁÂÁÂ

sheet.rar (238.21 KB)

¸ê®Æ

GinBow

TOP

¦^´_ 3# ginbow
  1. Sub data()
  2. nrow = Worksheets("sheet1").Range("A65536").End(xlUp).Row
  3. With Worksheets("sheet2").Range("A1:D" & Worksheets("sheet2").Range("A65536").End(xlUp).Row)
  4.   For i = 2 To nrow
  5.     .AutoFilter Field:=1, Criteria1:=DateValue(Worksheets("sheet1").Cells(i, 1))
  6.     .AutoFilter Field:=2, Criteria1:=Worksheets("sheet1").Cells(i, 8)
  7.     .AutoFilter Field:=3, Criteria1:=Worksheets("sheet1").Cells(i, 3)
  8.     .AutoFilter Field:=4, Criteria1:="¶RÅv"
  9.     .Offset(1, 4).Resize(, 1).SpecialCells(xlCellTypeVisible).Copy Worksheets("¿ï¾ÜÅv¸ê®Æ").Cells(i, 1)
  10.   Next
  11.   .AutoFilter
  12. End With
  13. End Sub
½Æ»s¥N½X

TOP

¦^´_ 4# register313


        ÁÂÁ§A¤w¸g­×§ï¦¨§Ú­nªº®æ¦¡¤F ·Q¥t¥~½Ð°Ý¤@¤U   §Ú¬O¥Î§A©Ò´£¥X¨Óªº²Ä¤G­Ó¤èªk      ¦ý©È¸ê®Æ¶q¦h®É®Ä²v·|¤ñ¸ûºC
      ¤W­±¤TºØ¤èªk­þ¤@ºØ®Ä²v·|¤ñ¸û§Ö©O?
GinBow

TOP

¦^´_ 5# ginbow
  1. Sub ¦r¨å()
  2. t = Timer
  3. Application.ScreenUpdating = False
  4. Set d = CreateObject("scripting.dictionary")
  5. With Worksheets("sheet1")
  6.   AR = .[A1].CurrentRegion
  7.   For i = 2 To UBound(AR)
  8.     d(AR(i, 1) & AR(i, 8) & AR(i, 3) & "¶RÅv") = ""
  9.   Next i
  10. End With
  11. With Worksheets("sheet2")
  12.   BR = .[A1].CurrentRegion
  13.   For i = 2 To UBound(BR)
  14.     If d.Exists(BR(i, 1) & BR(i, 2) & BR(i, 3) & BR(i, 4)) Then d(BR(i, 1) & BR(i, 2) & BR(i, 3) & BR(i, 4)) = BR(i, 5)
  15.   Next
  16. End With
  17. Worksheets("¿ï¾ÜÅv¸ê®Æ").[A2].Resize(d.Count, 1) = Application.Transpose(d.items)
  18. Application.ScreenUpdating = True
  19. MsgBox Timer - t & "’"
  20. End Sub
½Æ»s¥N½X
  1. Sub ¦Û°Ê¿z¿ï()
  2. t = Timer
  3. Application.ScreenUpdating = False
  4. nrow = Worksheets("sheet1").Range("A65536").End(xlUp).Row
  5. With Worksheets("sheet2").Range("A1:D" & Worksheets("sheet2").Range("A65536").End(xlUp).Row)
  6.   For i = 2 To nrow
  7.     .AutoFilter Field:=1, Criteria1:=DateValue(Worksheets("sheet1").Cells(i, 1))
  8.     .AutoFilter Field:=2, Criteria1:=Worksheets("sheet1").Cells(i, 8)
  9.     .AutoFilter Field:=3, Criteria1:=Worksheets("sheet1").Cells(i, 3)
  10.     .AutoFilter Field:=4, Criteria1:="¶RÅv"
  11.     .Offset(1, 4).Resize(, 1).SpecialCells(xlCellTypeVisible).Copy Worksheets("¿ï¾ÜÅv¸ê®Æ").Cells(i, 1)
  12.   Next
  13.   .AutoFilter
  14. End With
  15. Application.ScreenUpdating = True
  16. MsgBox Timer - t & "’"
  17. End Sub
½Æ»s¥N½X

TOP

¦^´_ 6# register313


    ÁÂÁ¤j¤j~
GinBow

TOP

        ÀR«ä¦Û¦b : §Ú­Ì³Ì¤jªº¼Ä¤H¤£¬O§O¤H¡D¥i¯à¬O¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD