vba 光学四等水准

10 篇文章 0 订阅

Sub 站数递增()
Dim i As Integer
Dim j As Integer
Dim Z As Integer
Dim X As Integer

For i = 9 To 24 Step 4
Z = Cells(i, 18)
For X = 9 To 62 Step 4
If (Cells(X, 1).Row - 5) / 4 <= Z Then Cells(X, 1) = (X - 5) / 4
 Next X
 Next i
End Sub

Sub 段1红黑尺()
Dim i As Integer
Dim j As Integer
Dim Z As Integer
Dim X As Integer
Dim M As Integer
Dim N As Integer
Dim C As Integer
Dim G As Double
 
 Z = Cells(9, 19)          '黑尺读数
 G = Cells(9, 20)
 For i = 9 To (Z * 4 + 1) Step 4
 Cells(i, 12) = Rnd() * 0.4 - 0.2                '中间点高差
 Cells(i + 2, 9) = Cells(i, 12) + Rnd() * 0.006 - 0.003  '后-前
 Cells(i, 9) = Rnd() * 1000 + 400              '中丝后黑尺读数

  Cells(i + 1, 9) = Cells(i, 9) - Cells(i + 2, 9) * 1000 '中丝前黑尺读数

 
 Cells(i, 3) = Round(Cells(i, 9) + 300 + Rnd() * 100)  '后尺上丝读数
 Cells(i + 1, 3) = Round(Cells(i, 9) - 300 + Rnd() * 100) '后尺下丝读数
 Cells(i + 2, 3) = (Cells(i, 3) - Cells(i + 1, 3)) / 10   '后尺距离
  Cells(i, 5) = Int(Cells(i, 3) - Cells(i + 2, 9) * 1000)         '前尺上丝读数
Cells(i + 1, 5) = Int(Cells(i + 1, 3) - Cells(i + 2, 9) * 1000 + Rnd() * 10 - 5) '前尺下丝读数
Cells(i + 2, 5) = (Cells(i, 5) - Cells(i + 1, 5)) / 10         '前尺距离
Cells(i + 3, 3) = Cells(i + 2, 3) - Cells(i + 2, 5)          '视距差=后-前


 If Cells(i, 1) Mod 2 = 1 Then
 Cells(i, 10) = Cells(i, 9) + 4787: Cells(i + 1, 10) = Cells(i + 1, 9) + 4687:  Cells(i + 2, 10) = (Cells(i, 10) - Cells(i + 1, 10)) / 1000
 Else:
 Cells(i, 10) = Cells(i, 9) + 4687: Cells(i + 1, 10) = Cells(i + 1, 9) + 4787:  Cells(i + 2, 10) = (Cells(i, 10) - Cells(i + 1, 10)) / 1000
   End If

 Next i

Cells(i, 12) = G - (Cells(i - 4, 12) + Cells(i - 8, 12) + Cells(i - 12, 12))
Cells(i + 2, 9) = Cells(i, 12) + Rnd() * 0.006 - 0.003
Cells(i, 9) = Rnd() * 1600 + 200
Cells(i + 1, 9) = Cells(i, 9) - Cells(i + 2, 9) * 1000

 If i = 9 Then                                                 '计算累积差
Cells(i + 3, 5) = Cells(i + 3, 3)
Else
Cells(i + 3, 5) = Cells(i - 1, 5) + Cells(i + 3, 3)

  End If
 
End Sub

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值