My form keeps getting deactivated (losing focus) when my code changes any data on a spreadsheet and the user is able to select different cells even though the form is still open as if it is now modeless.
In Module1:
Sub Button1_Click()
UserForm1.Show 'vbModal even with this on it still changes to modeless after entering data
End Sub
In UserForm1:
Private Sub CommandButton1_Click()
Range("A1").Value = "changed"
End Sub
Only after clicking the CommandButton1 does the form lose focus and the user can now click different cells.
I have made several other programs in Excel using VBA and edited and manipulated data without the form losing focus.
What has changed to my program?
In Module1:
Sub Button1_Click()
UserForm1.Show 'vbModal even with this on it still changes to modeless after entering data
End Sub
In UserForm1:
Private Sub CommandButton1_Click()
Range("A1").Value = "changed"
End Sub
Only after clicking the CommandButton1 does the form lose focus and the user can now click different cells.
I have made several other programs in Excel using VBA and edited and manipulated data without the form losing focus.
What has changed to my program?