Clearing a UserForm

Giordano Bruno

Well-known Member
Joined
Jan 7, 2007
Messages
1,341
I have a UserForm called Menu. The first line of code behind the OK button says

Menu.Hide

When I run this using F8, it behaves itself and the menu disappears after the code line Menu.Hide. When I click the OK button to run it normally the menu stays on the screen partially hidden behind the next sub menu.

Does anyone have any idea what I may be doing wrong?
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Hi Jindon,

Thanks for the thought. I wondered that and set it to true on the previous line, but it doesn't alter the odd behaviour.
 
Upvote 0
Hi, GIA. Well, The next form is actually an InputBox.

jindon. Unload doesn't work either.

Any more suggestions?
 
Upvote 0
Hi jindon,

I don't quite understand the reply. If by timing you are refering to sequence of events, the Menu Hide/Unload commands go before the InputBox which is in another macro called from the first. Does that anwer the question or have I missed something?
 
Upvote 0
So, Menu.Hide is not working for some reason...

Does it hide after InputBox disappear?
 
Upvote 0
Yes Jindon. Whether I click OK or Cancel on the Input box the UserForm disappears instantly.

If I run it using F8, it has disappeared long before the input box arrives.
 
Upvote 0

Forum statistics

Threads
1,214,950
Messages
6,122,436
Members
449,083
Latest member
Ava19

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top