Reputation: 387
I am running a code on vba and I display the results using the MsgBox. I want to keep these results displayed as I enter the result values in a separate excel file but Excel doesn't allow me to work on another excel file until I press OK or Cancel button on MsgBox. How do keep msgbox on and still work on the separate excel file ?
Upvotes: 3
Views: 3436
Reputation: 149287
Don't use a MsgBox
. Use a customized Userform
instead and then call it showing it as modeless
UserForm1.Show vbModeless
For example
Sub Sample()
'
'~~> Rest of your code
'
MsgBox "Hello World"
'
'~~> Rest of your code
'
End Sub
can be also written as
Sub Sample()
'
'~~> Rest of your code
'
UserForm1.Label1.Caption = "Hello World"
UserForm1.Show vbModeless
'
'~~> Rest of your code
'
End Sub
Upvotes: 4