![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 7
|
Private Sub CommandButton1_Click()
If TextBox1 = "" Then Call Search_productnumber(TextBox2) If TextBox2 = "" Then Call Search_productname(TextBox1) Else Call Search_productname(TextBox1) Call Search_productnumber(TextBox2) End If End If End Sub This If statement is supposed to search either textbox1 or textbox2 on a userform when the command button is clicked. I can't see what is wrong with it, could someone please help! |
|
|
|
|
|
#2 |
|
BatCoder
Join Date: Feb 2002
Location: Turkey
Posts: 764
|
elseIf in 4. line of your code
Private Sub CommandButton1_Click() If TextBox1 = "" Then Call Search_productnumber(TextBox2) elseIf TextBox2 = "" Then Call Search_productname(TextBox1) Else Call Search_productname(TextBox1) Call Search_productnumber(TextBox2) End If End If End Sub Regards |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|