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