Argument Not optional

Hemish

Registered User.
Local time
Today, 11:09
Joined
Jan 20, 2005
Messages
65
Hi i get this error message, when trying to run some code.

When i click a button get an error message Argument Not optional on Call ConvertToLetter.

There are no other functions with the same name. Not sure what i am doing wrong.


Private Sub Command0_Click()
Dim icol As Integer

icol = 30
Call ConvertToLetter
End Sub


Function ConvertToLetter(icol As Integer) As String
Dim iAlpha As Integer
Dim iRemainder As Integer
iAlpha = Int(icol / 27)
iRemainder = icol - (iAlpha * 26)
If iAlpha > 0 Then
ConvertToLetter = Chr(iAlpha + 64)
End If
If iRemainder > 0 Then
ConvertToLetter = ConvertToLetter & Chr(iRemainder + 64)
End If
End Function

Thanks
 
Not sure what i am doing wrong.

The function has a required argument that you are not providing when you call it. The function header reads;

Code:
Function ConvertToLetter([COLOR="Red"]icol As Integer[/COLOR]) As String
The item in red is a required argument, so when you call it you need to supply the value for this argument;

Code:
Private Sub Command0_Click()
Dim icol As Integer

icol = 30
Call ConvertToLetter([COLOR="red"]icol[/COLOR])
End Sub
 

Users who are viewing this thread

Back
Top Bottom