EXCEL語法編寫?

2016-12-13 6:08 pm
r = ActiveSheet.[A65536].End(3).Row
y = 1
For i = 1 To r
Next i
Range("A1:AN" & i).Copy
ActiveSheet.Paste Destination:=Range("AP" & y)
y = y + 1
請教大師們如何把下列語法編寫到上列中,(讓儲存格改變數值)謝謝!
˙"(Cells(i, 9 * 2), Cells(i, 12 * 3), Cells(i, 15 *4)"
更新1:

"(Cells(i, 9 * 2), Cells(i, 12 * 3), Cells(i, 15 *4)" 原來儲存格數值是沒有*2,*3,*4的,不知如何編寫語法在COPY貼上時,把 "(Cells(i, 9 * 2), Cells(i, 12 * 3), Cells(i, 15 *4)"改變數值.

更新2:

在COPY時,把改變儲存格數值的語法代進來,然後貼上. 改變數值的型式:"(Cells(i, 9 * 2), Cells(i, 12 * 3), Cells(i, 15 *4),,,,,"

更新3:

CHENG: 是類似, 實際需求:For j = 9 To 33 Step 3 請幫忙編寫正解!謝謝!

回答 (1)

2016-12-13 6:40 pm
✔ 最佳答案
˙"(Cells(i, 9 * 2), Cells(i, 12 * 3), Cells(i, 15 *4)"
要代入到哪???

類似...
j = 9
For i = 1 To [A65536].End(3).Row
Cells(i, j * (i + 1)).Copy Range("AP" & i)
j = j + 3
Next


收錄日期: 2021-05-03 13:55:13
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20161213100832AAsIAm0

檢視 Wayback Machine 備份