Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Function Argument
Try something like
Function Test(TBX As MSForms.TextBox) As String Test = TBX.Text End Function You can then call this with code like MsgBox Test(Me.TextBox1) -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "asmenut" wrote in message ... How would one go about creating a funtion that I can use a textbox as the argument? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Function Argument
You are never assigning a value to the Function, so it doesn't
return a value. You need some code in the function like Initials = SInit -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "asmenut" wrote in message ... Thanks. But when I plug in the function procedure, it doesn't work (See below) Am I asking it to do too much? Function Initials(SName As msForms.TextBox) As String Dim SInit As String Dim j As Long Dim sLetter As String SInit = Left(SName, 1) j = 1 While j 0 j = InStr(j, SName, " ") If j Then SInit = SInint & Mid(SName, j + 1, 1) j = j + 1 End If Wend End Function "Chip Pearson" wrote: Try something like Function Test(TBX As MSForms.TextBox) As String Test = TBX.Text End Function You can then call this with code like MsgBox Test(Me.TextBox1) -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "asmenut" wrote in message ... How would one go about creating a funtion that I can use a textbox as the argument? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Text Function 2nd argument | Excel Worksheet Functions | |||
How can I get around 30 argument limit of SUM function? | Excel Worksheet Functions | |||
Need Function Argument | Excel Worksheet Functions | |||
text as an argument of SUM function | Excel Worksheet Functions | |||
Pop-up function argument list | Excel Programming |