important problems in visual basic
Hello guys,
Many greetings,
I have some problem in visual basic, which are listed below : -
1) How to create a function with N number of parameters?
2)When array is created , it's intitial value is set from 0 , i want to start from 5 instead of zero.
Re: important problems in visual basic
Quote:
Originally posted by harishpatel
1) How to create a function with N number of parameters?
2)When array is created , it's intitial value is set from 0 , i want to start from 5 instead of zero.
You might try to use this:
Code:
Option Explicit
Public Function Test(ByVal arg1 As Long, Optional ByVal arg2 As Long = 5) As Long
Test = arg1 + arg2
End Function
Private Sub Form_Load()
MsgBox Test(1)
End Sub
See more about Function Statement: Function Statement - Visual Basic for Applications Reference
You should search allways MSDN online Library before asking help.
Have fun!