New to UserForms: My form usually flashes on and then disappears.

Mackeral

Board Regular
Joined
Mar 7, 2015
Messages
249
Office Version
  1. 365
Platform
  1. Windows
I'm using an example: Created the form, written some code, put the Command button on a sheet - but _
when I clock on it, the Form appears and then disappears. I have "Stop" commands at the beginning of every routine.

I click on the prompt button, it goes into the selection/Load program and shows the UserForm, but after a few seconds it usually closes the User Form and leaves VBA in "running" mode. But once it actually did stop in the processing routine.

The calling code is
VBA Code:
Sub CommandButton1_Click()
    Stop
    ufGetData.Show
End Sub


And thsi first code it would go into processing the User form is
VBA Code:
Sub cmdOk_Click()

    Stop
    Dim wf As WorksheetFun

    wf = Application.WorksheetFunction

    ' Make sure a name is entered.

    If Len(Me.tbxName.Text) = 0 Then

        MsgBox "You must enter a name."

        Me.tbxName.SetFocus

  

    Else

        Next_Row = wf.ConttA(Sheets("Test").Range("A:A")) + 1


        ' Clear codes.

        Me.tbxName.Text = ""

        Me.OptUnknown.Vale = True

        Me.tbxName = SetFocus

      

    End If

  

    Stop

End Sub

Any idea what's going on?
Thanks, Mac
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
I figured out what the problem was.
I had one screen over writing the userform code.
Solved!
 
Upvote 0
Solution

Forum statistics

Threads
1,224,521
Messages
6,179,277
Members
452,902
Latest member
Knuddeluff

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