1. Sub trnprg()
2. Dim myrow As Long
3. Dim myrange As Range
4 Dim i As Integer
5 myrow = Range("a1").End(xlDown).Row
6 For i = 2 To myrow
7 Set myrange = Cells(i, 1)
8 If myrange <> Empty Then
9 Cells(i, 2).FormulaR1C1 = "=VLOOKUP(CELLS(1,I),Jsc_Data!A:G,6,FALSE)"
10 Cells(i, 5).FormulaR1C1 = "=CONCATENATE(""代墊款""," - ",LEFT(cells(i,2))"