Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Give focus to workbook after msgbox

Status
Not open for further replies.

MikeCDPQ

Technical User
Sep 11, 2003
173
CA
I have a script where I would like to have a msgbox:

msgbox("Please take a look at data and click OK if satisfied", vbOKCancel+vbDefaultButton1+vbInformation,"Data verification")

Basically halt the execution until user clicks OK

That would work just fine but the problem is, in order to look at the worksheet, the user needs to be able to scroll up and down on the spreadsheet.

How do I give my spreadsheet its focus back with still having the message box on screen.

If it existed I would use the opposite of :vbMsgBoxSetForeground (vbMsgBoxSetBackground)

Any ideas anyone.

Thanks in advance.

 
Mike
Check out the FAQ area. TonyJollans has done an excellent FAQ that should solve your problem
title is something like "...create message box that doesn't lock the application..."

;-)

If a man says something and there are no women there to hear him, is he still wrong? [ponder]
The faqs ma'am, just the faqs. Get the best from these forums : faq222-2244
 
Thanks Loomah,

I had not seen that one. That's exactly what I was looking for.

Thanks a bunch.

Mike
 
You may consider the Application.InputBox method:
Set myCell = Application.InputBox( _
Prompt:="Please take a look at data and click OK if satisfied", _
Title:="Data verification", Type:=8)

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Hi PHV,

That doesn't work, it gives me an input box instead of a msgbox and it also keeps the focus. I can't navigate on my spreadsheet.

I am contemplating Loomah's solution or building my own form (still not used to this option but working on it :))

Thanks for your time.

Mike
 
it also keeps the focus
With Type:=8, I can navigate within my sheets.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Not an infalable Method as the User needs to have
a scroll wheel / enable Mouse

Code:
    AppActivate "Microsoft Excel"
    MsgBox "Use your scroll wheel to scroll up/down"

Ivan F Moala
xcelsmall.bmp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top