Clearing a UserForm

Giordano Bruno

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

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

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,255
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,255
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,255
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,255
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.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,147
Messages
5,835,669
Members
430,373
Latest member
swartzfeger

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