Why did you write the above in your original post?
There is a lot you are not telling us. All those variables you are assigning
things to... Where are the Dim'med at? Do you have vntX Dim'med elsewhere?
Are you actually making it through the function and dying elsewhere? For
this latter question, put a breakpoint on the End Function line and run your
code... do you make it to the breakpoint or not? If not, put a breakpoint on
the Split statement line and then press F8 until your code dies... what line
did it die on? Can you show us the formula (your function is a UDF, right?)
you are using to call the function (in particular, I'm interested in the
original text you are trying to split). We would also be interested in any
other details about what you are doing that you think may impact your use of
the function.
Rick
There is alot, i havent said, for instance this is the only split
function and vntX that i have, these variables are assigned
I have set the values to text boxes and a combobox Im still very new
to "programming" so i really dont know any of the tricks, and my code
is really bad looking, basically what i was trying to do with this,
Private Sub CmdEdit_Click()
Dim strNames As String
Dim vntX as Variant
If CBONames.Text = "" Then
MsgBox "Select a Name Please"
End If
If CBONames.Text <> "" Then
strNames = GetInfo(CBONames.Text)
End If
End Sub
Private Function GetInfo(MyTxtName As String)
Dim Tester As String
Dim Thistest As String
ActiveSheet.Unprotect Password:="g45721"
Thistest = Range("A5:AX4500").Find(LblName,
LookIn:=xlValues).Offset(0, 25)
Tester = SplitMe(Thistest)
If MyTxtName = Tester Then
GetInfo = Thistest
End If
Private Function SplitMe(strToSplit As String)
Dim vntX As Variant
Dim First As String
Dim last As String
Dim child As String
Dim issed As String
Dim served As String
vntX = Split(strToSplit, ",")
First = vntX(0) ' FirstName
last = vntX(1) ' Last NameCBOMoFa = vntX(2) ' Mother/Father
SplitMe = First & "," & last
End Function