Is there anyway to have a userform that acts modeless, while still pausing code execution like a modal form?
I\'d like the userform to show, but still allow interact
The Best method would be to use two different subs. I was able to solve this problem without splitting my sub as follows:
Public Mode as Boolean
Sub Stuff()
If Mode Then
Goto Continue
End If
'Code before Userform
Mode = True
Userform.Show vbModeless
Exit Sub
Continue:
Mode = False
'Rest of your code
End Sub
I made "Mode" a global variable because I use this userform for multiple subs. If you are using a single sub you can use it locally. I also made "Mode" false when opening this workbook by going under "ThisWorkbook" Tab and adding the following code:
Private Sub Workbook_Open()
Mode = False
End Sub
This again will only be needed if you use your userform for more than one sub. Last add this code under your Userform code when your proceed button is pressed.
Private Sub Confirm_Click()
Userform.hide
if Mode Then
Call Stuff
End If
End Sub
If you are only are using the one sub method skip the if statement and just call the sub.