未完成---为空得判断 和运算

1 为空得判断  用len()可以

  If Len(p01) = 0 Then   'p07 = ""这个不行 IsNull(p01) 也不行?

2 p1*1    p1+0也不行

3 但是,写转得if 函数太多了太傻

4 暂时加on error resume next  暂时解决

1  

'     If Len(p01) = 0 Then   'p07 = ""这个不行 IsNull(p01) 也不行?
'        p01 = 0
'     End If
'
'     If Len(p02) = 0 Then
'        p02 = 0
'     End If
'
'     If Len(p03) = 0 Then
'        p03 = 0
'     End If
'
'     If Len(p04) = 0 Then
'        p04 = 0
'     End If
'
'     If Len(p05) = 0 Then
'        p05 = 0
'     End If
'
'     If Len(p06) = 0 Then
'        p06 = 0
'     End If
'
'     If Len(p07) = 0 Then
'        p07 = 0
'     End If
'
'
'     If Len(p08) = 0 Then
'        p08 = 0
'     End If
'
'     If Len(p09) = 0 Then
'        p09 = 0
'     End If
'
'     If Len(p010) = 0 Then
'        p010 = 0
'     End If
'
'        If Len(p011) = 0 Then
'        p011 = 0
'     End If
'
'     If Len(p012) = 0 Then
'        p012 = 0
'     End If
'
'     If Len(p013) = 0 Then
'        p013 = 0
'     End If
'

      
     Debug.Print "p01=" & p01
     Debug.Print "p02=" & p02
     Debug.Print "p03=" & p03
     Debug.Print "p04=" & p04
     Debug.Print "p05=" & p05
     Debug.Print "p06=" & p06
     Debug.Print "p07=" & p07
     Debug.Print "p08=" & p08
     Debug.Print "p09=" & p09
     Debug.Print "p010=" & p010
     Debug.Print "p011=" & p011
     Debug.Print "p012=" & p012
     Debug.Print "p013=" & p013

    '先随个数
    On Error Resume Next
    Randomize
    p0 = p01 * 1 + p02 * 1 + p03 * 1 + p04 * 1 + p05 * 1 + p06 * 1 + p07 * 1 + p08 * 1 + p09 * 1 + p10 * 1 + p11 * 1 + p12 * 1 + p13 * 1
    p1 = Int(1 + (p0) * Rnd)
    Debug.Print "p1=" & p1

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值