Create Sticky (Always-on-top) Popup

0

0-0 Wai Wai ^-^

I'm new to VBA.

1) How can I create a sticky (Always-on-top) popup
MsgBox "This message is sticky"
The above code will pop up a dialog, but how to make it sticky?

2) How to create a function which customize the content of the popup?
I would like to create a function like this:
Fictional Code: Function Messagebox(text, sticky_or_not)

Thank you.
 
N

NickHK

Look into making a userform and ".Show, vbModeless".
You can change the text by setting the .Caption of a label on the userform :
UserForm1.Label1.Cation="Some new text"

Otherwise, explain what you mean by "sticky".

NickHK
 
0

0-0 Wai Wai ^-^

"Sticky" here means the window/dialog is always on top of the screen. In other
words, keep it on top.
 
0

0-0 Wai Wai ^-^

Look into making a userform and ".Show, vbModeless".
You can change the text by setting the .Caption of a label on the userform :
UserForm1.Label1.Cation="Some new text"

It seems not what I do.
What I want is to use functions to customsie the text.
For example, I type a formula in A1 - Messagebox(condition, text,
sticky_or_not).
When the condition is met, the message will popup (and will be always on top of
the screen if you select this option).
 
N

NickHK

You can make a public function and show the userform from there.

Public Function TestUDF(argRange As Range) As Long
If argRange.Value>10 Then UserForm1.Show vbModeless
TestUF = 100
End Function

NickHK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top