Hi everyone,
I have the following code on a cancel button in a userform that causes a message box to appear warning the user that they'll lose all changes if they press cancel:
The only problem is that if the user clicks the close button in the top corner of the form dialogue itself, instead of cancel, there will be no message to warn them that they'll lose changes. Is it possible to code the form close button itself similar to what I have on the cancel button?
Also I'm noticing two problems with the textboxes on the userform. The first is that I can't copy and paste text into the boxes. Is there a way to allow this functionality?
Lastly, on single line textboxes, when text is entered I notice that it's not centered vertically within the textbox - it's aligned to the top. Is there a way to have it center vertically?
Thanks again for any help offered.
I have the following code on a cancel button in a userform that causes a message box to appear warning the user that they'll lose all changes if they press cancel:
Code:
Private Sub cmdCancel_Click()
Dim result As Integer
result = MsgBox("Are you sure you want to Cancel? You will lose all changes.", vbYesNo + vbQuestion)
If result = vbYes Then Unload Me
frmEnergeticsProposal.Show
Set frmEnergeticsProposal = Nothing
End Sub
The only problem is that if the user clicks the close button in the top corner of the form dialogue itself, instead of cancel, there will be no message to warn them that they'll lose changes. Is it possible to code the form close button itself similar to what I have on the cancel button?
Also I'm noticing two problems with the textboxes on the userform. The first is that I can't copy and paste text into the boxes. Is there a way to allow this functionality?
Lastly, on single line textboxes, when text is entered I notice that it's not centered vertically within the textbox - it's aligned to the top. Is there a way to have it center vertically?
Thanks again for any help offered.