Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21879

Form changes from Modal to Modeless when changing sheet cell and deactivates

$
0
0
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?

Viewing all articles
Browse latest Browse all 21879

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>