Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Write data back from a form to sheet | Excel Discussion (Misc queries) | |||
Form keep the focus unable to get to the code - HELP! | New Users to Excel | |||
Opens to form then keep focus and unable to get to code - HELP!! | Excel Discussion (Misc queries) | |||
File in 2007 form - need to get back to 2003 form... | Excel Discussion (Misc queries) | |||
How do I get focus back on an Excel file? | Charts and Charting in Excel |