# Visual Basic > Office Development >  From function to sub

## Bjede

Hey..
I'm having troubles to get info from my function, and back again to my sub.. whats wrong?


```
Public Sub Member()
Dim MemberID As Integer
Dim Member As Integer


Do
    MemberID = InputBox("write membernumber", "which member du you want?")
    
    TFMember= TjeckMember(MemberID)
    
    If TFMember= False Then
        MsgBox ("member not valid. try again.")
    End If
    
Loop Until Member = 1



End Sub


Public Function TjeckMember(MemberID As Integer) As Integer
Dim IDRange As Range
Dim ID As Variant


With ThisWorkbook.Worksheets("Members")

    Set IDRange = Range(Range("A2"), Range("A2").End(xlDown))
    
    For Each ID In IDRange
        If ID = MemberID Then
            TFMember= True
            
            Exit For
        Else
            TFMember = False
            
        End If
    Next ID
    
End With

End Function
```

Really hope you can help...

Bjede

----------


## timeshifter

First, this belongs in a technical forum.

Second, you aren't returning a value within your function. You have the function defined to return an Integer, but you never specify TO return said integer.

----------


## Bjede

Sorry.. are there any technical forum in here?

----------


## timeshifter

Most of them are technical. Don't worry, a mod will move it once they see it.

----------


## Bjede

allright..thx

----------


## Bjede

well.. problem solved..

----------


## si_the_geek

As you appear to be working in Excel, I have moved this thread to our _Office Development_ forum.

----------

