VBA显示无效外部过程该怎么弄呢
DimWAsSingleDimPAsSingleW=68.5IfW<=50ThenP=W*4ElseP=W*2EndIfEndSub这是过程,W=68.5这里出了错,求各...
Dim W As Single
Dim P As Single
W = 68.5
If W <= 50 Then
P = W * 4
Else
P = W * 2
End If
End Sub
这是过程,W = 68.5这里出了错,求各位大神帮忙求解求解 展开
Dim P As Single
W = 68.5
If W <= 50 Then
P = W * 4
Else
P = W * 2
End If
End Sub
这是过程,W = 68.5这里出了错,求各位大神帮忙求解求解 展开
1个回答
展开全部
你的代码开头加上sub没有问题,建议截个图
Sub a()
Dim W As Single
Dim P As Single
W = 68.5
If W <= 50 Then
P = W * 4
Else
P = W * 2
End If
End Sub
追问
但是运行完没有出答案是怎么回事呢?
追答
因为你没有显示答案的语句
Sub a()
Dim W As Single
Dim P As Single
W = 68.5
If W <= 50 Then
P = W * 4
Else
P = W * 2
End If
MsgBox ("P=" & P)
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询