Excel VBA ComboBox1_DropButtonClick Event -


Text after "

I got the macro below which twice in the fire (twice showing the same MessageBox). Firstly when ComboBox1 opens and the second when ComboBox1 closes.

  Private Sub ComboBox1_DropButtonClick () If Me.ComboBox2.Text = "" then fill the MsgBox "text box" remaining Fill the End End Sub End  

Is there any way to show him a message box once? I want to select the value in ComboBox1 before the user first clicks on ComboBox2 DropButton.

After

Here is a very unelegant using a "count" variable, which is the first time the messagebox And secondly does not

  integer combo box 1_DropButtonClick () count = count + 1 if Me.ComboBox2.Text = "" then calculate = 1 then MsgBox "Fill text box" Other count = 0 End otherwise if you end up with 'End Sub'  

However, I do not need to use one of the most drop buttons ComboBox1_Change () Suggest event to use.

PS: The "counting" variable needs to be out of the declaration method. This is due to the fact that:

  • If it stays inside, then it is a local variable of the method and therefore loses its amendments every time the method is over;
  • If it remains outside, once again the method will keep this amendment that its race is over.

Comments

Popular posts from this blog

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -

java - Algorithm negotiation fail SSH in Jenkins -