Hi, need help in these codes, these codes search in "invdatabase" sheet column G1 for invoice no. if not found than start pasting in "invdatabase" sheet from G1 and so on another columns, my problem is that, it should search the value in G1 but start pasting values from A1 columns and so on....
VBA Code:
If Rng Is Nothing Then
Set Rng = Worksheets("invdatabase").Range("G1")
If Rng.Offset(1, 0) <> "" Then Set Rng = Rng.End(xlDown)
End If
Rng.Offset(1).Resize(, 13).Value = Array(Quot_No, Quot_Date, Po_No, Po_Date, Do_No, Do_Date, Inv_No, Inv_Date, Cust_Name, Tax_Value, Vat, Total_Amount, Auth_Name)
i = 13
For r = 1 To 30
For j = 1 To 4
C = Choose(j, 1, 2, 4, 5)
Debug.Print .Range("A21:A50,B21:B50,D21:D50,E21:E50").Cells(r, C).Address
Rng.Offset(1, i).Value = .Range("A21:A50,B21:B50,D21:D50,E21:E50").Cells(r, C)
i = i + 1
Next j
Next r