Pop msgbox but still allow excel to be available

brulet

New Member
Joined
May 6, 2011
Messages
20
Hi,

I've been trying to pop a message box with a button that computes a value, with a compute button, and isn't active, and allows the user to access the spreadsheet to enter some values. Is there a setting to show the msgbox, but make the spreadsheet active over the msgbox (I guess also making the msgbox always stay on the top).

Thanks for any help you guys can provide,

BT
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Hi,

I've been trying to pop a message box with a button that computes a value, with a compute button, and isn't active, and allows the user to access the spreadsheet to enter some values. Is there a setting to show the msgbox, but make the spreadsheet active over the msgbox (I guess also making the msgbox always stay on the top).

Thanks for any help you guys can provide,

BT


Showmodal = false .. ahh :D
 
Upvote 0
Not as far as I'm aware - MsgBox holds the focus until you dismiss it.

You could use a non-modal userform but as soon as you click on the worksheet, the userform will drop behind the worksheet.

You could use Application.InputBox to get the address of a cell and then do a .Value on that:-
Code:
Set MyRange = Application.InputBox("Select range:-", , , , , , , Type:=8)
SomeVariable = MyRange.Value
You'd be safest checking that the user had only selected a single cell before trying to do a .Value on it.
 
Upvote 0
In case you are interested, sometime ago I coded some modeless MsgBox. Take a look at post6 HERE.

Obviously, the suggested modeless userform approach is much easier.
 
Upvote 0
Excellent - well worth keeping a copy of that for the occasion when it comes in useful.

@Brulet: the code pasted into a pair of standard modules and workd first time, so it will only cost you a couple of minutes to test this.
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,750
Members
452,940
Latest member
rootytrip

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