Example of the code:
Sub
Dim NOSSPrefix As String
NOSSPrefix = Cells(1, 6).Value
NOSSSpecific(NOSSPrefixSpec)
End Sub
Function NOSSSpecific(NOSSPrefixSpec)
If NOSSPrefixSpec = "6" Or NOSSPrefixSpec = "17" Or NOSSPrefixSpec = "19" Then
NOSSPrefix = NOSSPrefixSpec
Else
NOSSPrefix = "999"
End If
End Function
Tried alreaddy return, set, ... Just want to return the NOSSPrefix back from the function to the routine above.
NOSSSpecific = NOSSPrefixas the last line in the FunctionOption Explicitwould pick up the fact that your main subroutine is passing a variable (NOSSPrefixSpec) to the function even though that variable had never been assigned a value previously - the previous line is setting a variable calledNOSSPrefix.