IF Logic

skull_eagle

Board Regular
Joined
Mar 25, 2011
Messages
89
Hi,

I'm struggling with the logic with this one.

Both IF statements work fine on their own, combined I'm getting MtrxSub sub called up to 4 times.

Thank you


VBA Code:
Private Sub Matrix_BTN_Click()


If Search_Form.Controls("TB_71") <> "" Then

Worksheets("Admin").Range("P8").Value = Search_Form.Controls("TB_71")

Call MtrxSub

Else

MsgBox "Please enter a Job Number"

Exit Sub

End If


If Search_Form.Controls("Results_1").Caption <> "0" Then

Worksheets("Admin").Range("P8").Value = Search_Form.Controls("TB_71")

Call MtrxSub

Else

MsgBox "No results to display"

Exit Sub

End If


End Sub
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Is that the IFs combined? What does MtrxSub contain?
 
Upvote 0
How was "Search_Form.Controls" defined?
 
Upvote 0

Forum statistics

Threads
1,216,075
Messages
6,128,657
Members
449,462
Latest member
Chislobog

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top