Sub 行互换() ? ? Dim a As Variant ? ? a = Range("c1:c224").Value ? ? Range("c1:c224").Value = Range("d1:d224").Value ? ? Range("d1:d224").Value = a
Range("K2:K224").NumberFormatLocal = "hh:mm:ss" ? ? ?'设置时间格式
End Sub
Sub 产生0.0001的随机数()
Dim arr(1 To 100), i Randomize For i = 1 To 100 Step 4 arr(i) = ((Rnd / 1000)) ?'Rnd[0,1) Cells(i, 5) = Round((Cells(i, 1) + Cells(i, 4)), 3) Next Range("A1").Resize(100, 1) = Application.Transpose(arr)
End Sub
Sub 验测点()
Dim i As Integer For i = 1 To 200
If Cells(10, 1).Value = "GPS31" Then Cells(10, 11).Value = Cells(10, 2).Value - Cells(142, 2).Value ?If Abs(Cells(10, 11).Value) > 0.05 Then Cells(10, 11).Font.Color = vbRed If Abs(Cells(10, 11).Value) < 0.05 Then Cells(10, 11).Font.Color = vbBlack ? Next End Sub
|