Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default How to set focus back to sheet after showing a user form

Hi Bill

I tried the ActiveSheet.Select in the various places, but none of
them worked - stepping through the code passes those lines
correctly but in all cases the UserForm just keeps the focus. Have
tried all combinations that I can think of (ActiveCell.Activate
etc etc ....... ) but nothing appears to remove the focus from the
UserForm. Also, have tried everything in various places throughout
the code that runs during the UserForm initialization etc.

All I'm trying to do is to remove the single step where the user
has to click on the sheet once to regain the focus before the
cursor keys let them move cell to cell.

By the way, it's Excel 2000 sp3 that I'm using.

Thanks for your help.

regards,
--
Les Hay, Livingston. Scotland

"Bill Lunney" wrote in message
...
Using Excel 2003 beta just now but standard behaviour is the

worksheet keeps
focus when displayed modeless.

I tried it using:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range,

Cancel As
Boolean)
UserForm1.Show vbModeless
End Sub


However if you're not getting this behaviour in your version

just add
something like:


Private Sub UserForm_Initialize()
ActiveSheet.Select
End Sub

to the init event of your form. That should reactivate the

worksheet and
subsequently the activecell.



--

Regards,


Bill Lunney
www.billlunney.com

"Les" wrote in message
...
Hi

I have a modeless UserForm which opens on a DoubleClick

event -
working fine. How can I do this but have the focus remain with

the
ActiveCell? Or, alternatively, have the focus leave the newly
opened UserForm?

regards,
--
Les Hay, Livingston. Scotland






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Write data back from a form to sheet Steen Excel Discussion (Misc queries) 9 October 22nd 08 01:22 PM
Form keep the focus unable to get to the code - HELP! Kaz G New Users to Excel 1 January 23rd 08 06:00 PM
Opens to form then keep focus and unable to get to code - HELP!! Kaz G Excel Discussion (Misc queries) 0 January 23rd 08 01:16 AM
File in 2007 form - need to get back to 2003 form... RHM Excel Discussion (Misc queries) 2 May 7th 07 05:38 AM
How do I get focus back on an Excel file? Stumpiana Charts and Charting in Excel 1 November 18th 05 01:21 AM


All times are GMT +1. The time now is 09:19 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"