我正在從一個文件到另一個信息,使用其他文件:(7.xlsx是文件名)接入小區與可變
Cells(13, 4).Select
ActiveCell.FormulaR1C1 = "=[7.xlsx]sheet1!R3C5"
在這種情況下,這是我在信息從C5現貨。 但是我想只從這個位置獲取信息,但是從不同的位置使用循環。
Dim i As Integer
For i = 3 To 17
Cells(i, 4).Select // works fine
ActiveCell.FormulaR1C1 = "=[7.xlsx]sheet1!R3C5" // I want to put the
// "i" instead of the C
任何想法我怎麼能做到這一點?
在此先感謝!
Try:「= [7.xlsx] sheet1!R3」&i&「5」 – Wernerson
@Wernerson Thanks! – Dave