请,我想在条件中复制同一张纸的另一个单元格中的单元格数据:
你可以在这里找到我的代码
For i = 1 To table1Rows
table1(1 + i, 27) = table1(1 + i, 1) & " ; " & table1(1 + i, 2) & " ; " & table1(i + 1, 40) & " ; " & table1(i + 1, 17) & " ; " & Right(table1(i + 1, 4), 20) & " ; " & table1(i + 1, 3) & " ; " & Right(table1(i + 1, 41), 16) & " ; " & Right(table1(i + 1, 42), 12) & " ; " & Right(table1(i + 1, 44), 12) & " ; " & Right(table1(i + 1, 46), 16) & " ; " & table1(i + 1, 47) & " ; " & table1(i + 1, 48)
Next
答案 0 :(得分:0)
试试这个:
For i = 1 To table1Rows
temp = table1(1 + i, 1) & " ; " & _
table1(1 + i, 2) & " ; " & _
table1(i + 1, 40) & " ; " & _
table1(i + 1, 17) & " ; " & _
Right(table1(i + 1, 4), 20) & " ; " & _
table1(i + 1, 3) & " ; " & _
Right(table1(i + 1, 41), 16) & " ; " & _
Right(table1(i + 1, 42), 12) & " ; " & _
Right(table1(i + 1, 44), 12) & " ; " & _
Right(table1(i + 1, 46), 16) & " ; " & _
table1(i + 1, 47) & " ; " & _
table1(i + 1, 48)
' table1(1 + i, 27) = Left(temp & Space(20), 20)
table1(1 + i, 27) = Left(temp & " ", 20) 'Edited as per comment
Next