-
Newbie Function Compile Error
Hi I am a newbie, and have a question. I am messing around with creating forms and such (in Excel 2003). But while working with a function I get the following error:
Compile Error:
Expected: =
This is my code
[vba]Private Sub OptionButton1_Change()
If OptionButton1.Value = True Then
clearDetails 'this clears the textboxes in the form
getDetails (var1) 'this calls a function to get the details from a worksheet and populate various text boxes in my form. It passes one variable.
End If
End Sub
Function getDetails (temp1)
'this is the code that searches thru a worksheet for the "temp" value and places various values into textboxes in my form
End Function
[/vba]
This works fine. But now I want to pass two variables to the function. When I change the code to call the function to the following I get the above mentioned error:
[vba] getDetails (var1, var2) 'this calls a function to get the details from a worksheet that matches the value in textBox1[/vba]
Thanks in advance.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules