代码复用的小例子

Sub CodeShare(Source As Button)
Dim sType As String
Dim i As Integer
sType = "N"
If sType = "N" Then
For j=0 To 3
Msgbox "N"
Gosub lala
j = j + 1
Next
Else
Msgbox "1"
Goto lala
End If
Exit Sub
lala:
Msgbox "executing"
Return
End Sub

你可能感兴趣的:(J#)