vba编写一个程序
发布网友
发布时间:2022-10-11 19:12
我来回答
共2个回答
热心网友
时间:2023-10-14 14:28
这个很简单
Sub Macro1()
'
' Macro1 Macro
Dim i As Integer, N As Integer
N = 1 + 5 * Rnd()
Cells(1, 7).Value = N
Range("A" & N & ":C" & N + 1).Select
Selection.Copy
Range("D1").Select
ActiveSheet.Paste
End Sub追问是呀
没有g1我也会呀
怎么
以g1作为abc列第g1行
以g1+1作为abc列第g1+1行
热心网友
时间:2023-10-14 14:28
Sub tt()
Dim i As Integer
i = Int(Rnd(5) * 5 + 1)
Sheet1.[g1] = i
Sheet1.[d1] = Sheet1.Cells(i, 1)
Sheet1.[e1] = Sheet1.Cells(i, 2)
Sheet1.[f1] = Sheet1.Cells(i, 3)
Sheet1.[d2] = Sheet1.Cells(i + 1, 1)
Sheet1.[e2] = Sheet1.Cells(i + 1, 1)
Sheet1.[f2] = Sheet1.Cells(i + 1, 1)
End Sub追问def列第二行有问题