Clearing a UserForm

Giordano Bruno

Well-known Member
Joined
Jan 7, 2007
Messages
1,231
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?
 

Some videos you may like

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

jindon

MrExcel MVP
Joined
Aug 21, 2004
Messages
16,995
Aren't you setting ScreeUpdating to False?

If so, set it back to True
 

Giordano Bruno

Well-known Member
Joined
Jan 7, 2007
Messages
1,231
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.
 

Gates Is Antichrist

Well-known Member
Joined
Aug 15, 2002
Messages
1,961
Is the subform modal? If you hit F8 then F5 does it reappear? I suspect F8 is deceiving you into thinking it's hidden.
 

jindon

MrExcel MVP
Joined
Aug 21, 2004
Messages
16,995

ADVERTISEMENT

Hummm

Have you tried Unload Menu
?
 

Giordano Bruno

Well-known Member
Joined
Jan 7, 2007
Messages
1,231
Hi, GIA. Well, The next form is actually an InputBox.

jindon. Unload doesn't work either.

Any more suggestions?
 

jindon

MrExcel MVP
Joined
Aug 21, 2004
Messages
16,995

ADVERTISEMENT

What timing are you hiding Menu?

InputBox may take precedence over UserForm.
 

Giordano Bruno

Well-known Member
Joined
Jan 7, 2007
Messages
1,231
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?
 

jindon

MrExcel MVP
Joined
Aug 21, 2004
Messages
16,995
So, Menu.Hide is not working for some reason...

Does it hide after InputBox disappear?
 

Giordano Bruno

Well-known Member
Joined
Jan 7, 2007
Messages
1,231
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,518
Messages
5,596,630
Members
414,082
Latest member
sasmita

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
Top