do you know which variable is "declared wrong"?
(during debugging, you should be able to put the cursor on the different
variables and see what the variable value is.)
Is the len of the input string what you think it should be?
"jocke" wrote:
HI, i've made a small function that counts the seconds i hours and
minutes
if i try to convert hours larger then 9 i get an error that says my
variable isn't
declared right. but i can't see anything wrong
Help wanted
Function sec(Invarde As String) As Long
Dim mystring As String
Dim antal As Integer
Dim hour As Integer
Dim minute As Integer
mystring = Invarde
antal = Len(mystring)
hour = Left(mystring, antal - 3)
minute = Right(mystring, 2)
SEC = (HOUR * 3600) + (MINUTE * 60)
End Function
--
jocke
------------------------------------------------------------------------
jocke's Profile: http://www.excelforum.com/member.php...nfo&userid=766
View this thread: http://www.excelforum.com/showthread...hreadid=473737