fs = "C:\Documents and Settings\USER\®à±\payment report 2012.xlsx"
Set Wb = Workbooks.Open(fs)
Set FRng = Wb.Sheets("New form of payment report").Range("k:k").Find(Date, lookat:=xlWhole, SearchDirection:=xlPrevious) '¦bb.xlsx ªºKÄæ´M§äµ¥·í¤éªº¤é´Áªº¤@¦C
fs = "C:\Documents and Settings\USER\®à±\payment report 2012.xlsx"
Set Wb = Workbooks.Open(fs)
Set FRng = Wb.Sheets("New form of payment report").Range("k:k").Find(Date, lookat:=xlWhole, SearchDirection:=xlPrevious) '¦bb.xlsx ªºKÄæ´M§äµ¥·í¤éªº¤é´Áªº¤@¦C
fs = "C:\Documents and Settings\USER\®à±\payment report 2012.xlsx"
Set Wb = Workbooks.Open(fs)
Set FRng = Wb.Sheets("New form of payment report").Range("k:k").Find(Date, lookat:=xlWhole, SearchDirection:=xlPrevious) '¦bb.xlsx ªºKÄæ´M§äµ¥·í¤éªº¤é´Áªº¤@¦C
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
End If
j = j - 1
i = i + 1
End If
Loop While j = 1
Wb.Close 0
End Sub
½Æ»s¥N½X
½Ð°Ý¤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§@ªÌ: stillfish00 ®É¶¡: 2012-12-13 17:36
Dim fs As String, xi As Integer
Dim i As Integer
Dim j As Integer
Dim k As Integer
i = Worksheets("outstanding payments").Range("A" & Worksheets("outstanding payments").Rows.Count).End(xlUp).Row
fs = "C:\Users\patrick.HKG\Desktop\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
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
¥i¥Hvlookup ¥X¨Ó¤F¡A¦ý¬O¥u¦³³Ì«á¤@Ó¡H
DO
Loop While
³o¥y¬O¤£¬O§Ú¼g¿ù¤F¡H§@ªÌ: 198188 ®É¶¡: 2013-4-17 15:44
If Worksheets("Oracle").Cells(I, 5).Value = customer And Worksheets("Oracle").Cells(I, 20).Value = 0 And Worksheets("Oracle").Cells(I, 28).Value >= Date Then
Set FRng = Worksheets(customer).Range("B:B").Find(Worksheets("Oracle").Cells(I, 1).Value, lookat:=xlWhole, SearchDirection:=xlPrevious)
If FRng Is Nothing Then
Set Rng = Worksheets("Filter").Range("A:A").Find(Worksheets("Oracle").Cells(I, 1), lookat:=xlWhole)