Sub test()
input_button = Cells(3, 9)
a = 2
a = input_button + (input_button * a)
c = 11
For b = 3 To 6
Cells(b, 10) = Cells(c, a)
c = c + 1
Next b
End Sub作者: zz0660 時間: 2024-6-14 07:55
感謝大大回答,您提供的程式沒有問題,只是跟我要的是相反的,所以我把Cells(b, 10) = Cells(c, a) 改成 Cells(c, a) = Cells(b, 10),就變成我要的樣子。
不過還缺少L3跟L5,這兩個數值。作者: xyz66217 時間: 2024-6-14 09:36
這種有規律的,再稍微推敲一下,可以得到公式
Sub test()
input_button = Cells(3, 9)
a = 2
a = input_button + (input_button * a)
c = 11
For b = 3 To 6
Cells(c, a) = Cells(b, 10)
Cells(18, a - 1) = Cells(3, 12)
Cells(19, a + 1) = Cells(5, 12)
c = c + 1
Next b
End Sub作者: 准提部林 時間: 2024-6-22 14:27
Sub Test_a1()
Dim xA As Range
Set xA = Cells(9, [i3] * 3 - 1)
xA(3, 2).Resize(4) = [j3:j6].Value
xA(10) = [L3].Value '
xA(11, 3) = [L5].Value
End Sub