用Excel如何编写下图题目的程序,题目要求一定要编写程序

2025-06-22 00:01:14
推荐回答(1个)
回答1:

Sub AA()
Dim ran As Range
 Range("A1") = 1
 Range("A1").AutoFill Destination:=Range("A1:A10"), Type:=xlFillSeries
 For Each ran In Range("B1:B10")
    ran = Rnd
 Next
 For Each ran In Range("C1:C10")
    ran = Int(Rnd * 10 + 1)
 Next
 Cells(11, 3) = 0
 For i = 1 To 10
   If Cells(11, 3) < Cells(i, 3) Then Cells(11, 3) = Cells(i, 3)
   Next
End Sub