我目前知道的有两种方法,一种是LZ的 工程>>添加过程(P)
一种是直接在代码里面添加,如:
Option ExplicitPrivate Sub Command1_Click()
Call NewPro '调用过程
End Sub
Public Sub NewPro() 'Public视调用范围可带可不带
MsgBox "这是你新添加的过程"
End Sub
有问题请追问,满意请采纳!
Private Function Test(a, b, c)p = (a + b + c) / 2
s = (p * (p - a) * (p - b) * (p - c))
Test = s
End Function
Private Sub Form_Load()
text4.Text = Test(Val(text1.Text), Val(text2.Text), Val(text3.Text))
End Sub
窗体Private Sub Command1_Click()
Dim l As Long, i As Integer
l = 0
For i = 1 To 10
l = l + N_jx(i)
Next
Text1.Text = l
End Sub
模块
Public Function N_jx(n As Integer) As Long
Dim i As Integer
N_jx = 1
For i = 1 To n
N_jx = N_jx * i
Next
End Function
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)