Private Sub Worksheet_Change(ByVal Target As Range)
Dim A As Range, Rng As Range
If Target.Column = 1 Then
With Sheets("oracle")
For i = 1 To .UsedRange.Rows.Count
Set A = .UsedRange.Rows(i).Find(Target)
If Not A Is Nothing Then
If Rng Is Nothing Then
Set Rng = .UsedRange.Rows(i)
Else
Set Rng = Union(Rng, .UsedRange.Rows(i))
End If
End If
Next
End With
End If
If Not Rng Is Nothing Then Rng.Copy Target.Offset(, 1)
If Target.Column = 1 Then ³oÓ¦n¹³¬O ·j´M½d³ò ¥Ln±N Target §ï¦¨ "TT" ¡A¥u¬O ¬Ý¤F¬Ý¡A·Pı¤£¶¶.....§@ªÌ: 198188 ®É¶¡: 2012-11-30 14:08
¦^´_ 3#GBKEE
Private Sub Worksheet_Change(ByVal Target As Range)
Dim A As Range, Rng As Range
If Target.Column = 1 Then
With Sheets("oracle")
For i = 1 To .UsedRange.Rows.Count
Set A = .UsedRange.Rows(i).Find(Target)
If Not A Is Nothing Then
If Rng Is Nothing Then
Set Rng = .UsedRange.Rows(i)
Else
Set Rng = Union(Rng, .UsedRange.Rows(i))
End If
End If
Next
End With
End If
If Not Rng Is Nothing Then Rng.Copy Target.Offset(, 1)
½Ð°Ý¤U±³o¥yþ¸Ì¥X¿ù¤F¡H °õ¦æ¶¥¬q¿ù»~¡¥9¡¦¡G°}¦C¯Á¤Þ¶W¥X½d³ò
If IsError(Application.VLookup(Wb.Worksheets("New form of payment report").Range("B" & j).Value, Worksheets("outstanding payments").Range("A:A"), 1, False)) Then
i = Worksheets("outstanding payments").Range("A" & Worksheets("outstanding payments").Rows.Count).End(xlUp).Row
fs = "C:\Documents and Settings\USER\®à±\payment report 2012.xlsx"
Set Wb = Workbooks.Open(fs)
With Worksheets("New form of payment report")
j = Worksheets("New form of payment report").Range("E" & Worksheets("New form of payment report").Rows.Count).End(xlUp).Row
End With
Do
If Wb.Worksheets("New form of payment report").Range("k" & j).Value = Date And Wb.Worksheets("New form of payment report").Range("h" & j).Value >= 0.95 Then
If IsError(Application.VLookup(Wb.Worksheets("New form of payment report").Range("B" & j).Value, Worksheets("outstanding payments").Range("A:A"), 1, False)) Then
Worksheets("outstanding payments").Range("A" & i + 1) = Wb.Worksheets("New form of payment report").Range("B" & j).Value
Worksheets("outstanding payments").Range("F" & i + 1) = Wb.Worksheets("New form of payment report").Range("H" & j).Value
j = Worksheets("New form of payment report").Range("E" & Worksheets("New form of payment report").Rows.Count).End(xlUp).Row
End With
Do
ThisWorkbook.Activate
If Wb.Worksheets("New form of payment report").Range("k" & j).Value = Date And Wb.Worksheets("New form of payment report").Range("h" & j).Value >= 0.95 Then
If IsError(Application.VLookup(Wb.Worksheets("New form of payment report").Range("B" & j).Value, Worksheets("outstanding payments").Range("A:A"), 1, False)) Then
Worksheets("outstanding payments").Range("A" & i + 1) = Wb.Worksheets("New form of payment report").Range("B" & j).Value
Worksheets("outstanding payments").Range("F" & i + 1) = Wb.Worksheets("New form of payment report").Range("K" & j).Value
End If
i = i + 1
End If
j = j - 1
Loop While j = 2
Wb.Close 0
End Sub
½Æ»s¥N½X
½Ð°Ý
Do
Loop While
¬O¤£¬O¼g¿ù¤F¡H¥L¤£À´±o´`Àô°µ§@ªÌ: GBKEE ®É¶¡: 2012-12-14 14:54