ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   X button query (https://www.excelbanter.com/excel-programming/339045-x-button-query.html)

Greg B[_5_]

X button query
 
Hi all how can I have it when someone clicks on the X button of any userform
it loads up the userform"main"

Thanks in advance

Greg



Mark Hone

X button query
 
Hi Greg,

Try inserting this code into the QueryClose event for each form in question:
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
main.Show
End If
End Sub

Hope this helps,

Mark


"Greg B" wrote:

Hi all how can I have it when someone clicks on the X button of any userform
it loads up the userform"main"

Thanks in advance

Greg




Greg Brow[_3_]

X button query
 


Thanks did not think of it that way

Greg

*** Sent via Developersdex http://www.developersdex.com ***

Greg B[_5_]

X button query
 
It is ok Some one has helped me on this one.

Greg
"Greg B" wrote in message
...
Hi all how can I have it when someone clicks on the X button of any

userform
it loads up the userform"main"

Thanks in advance

Greg






All times are GMT +1. The time now is 05:49 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com