ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   After checking control checkbox returning focus to the sheet (https://www.excelbanter.com/excel-programming/297882-after-checking-control-checkbox-returning-focus-sheet.html)

Don Wiss

After checking control checkbox returning focus to the sheet
 
After a user has checked a control checkbox, the focus normally remains on
the control. I don't like this. Now to return the focus to the sheet I'm
using:

ActiveWindow.RangeSelection.Select

But this is less than perfect. If the active cell is not in view, the
spreadsheet will jump to put it in view. Is there some other way I can
return the focus to the sheet without this quirk?

Thanks, Don <donwiss at panix.com.

BrianB

After checking control checkbox returning focus to the sheet
 
ActiveSheet.Range("A1").Selec

--
Message posted from http://www.ExcelForum.com


BrianB

After checking control checkbox returning focus to the sheet
 
Sorry, this is what you really want :-

ActiveWindow.VisibleRange.Cells(1, 1).Selec

--
Message posted from http://www.ExcelForum.com


Vic Eldridge

After checking control checkbox returning focus to the sheet
 
The checkboxes from the Forms toolbar don't take focus when clicked.
But if you must use the ActiveX checkbox, try the following.

Private Sub CheckBox1_Click()
SendKeys "{ESC}"
End Sub


Regards,
Vic Eldridge



Don Wiss wrote in message . ..
After a user has checked a control checkbox, the focus normally remains on
the control. I don't like this. Now to return the focus to the sheet I'm
using:

ActiveWindow.RangeSelection.Select

But this is less than perfect. If the active cell is not in view, the
spreadsheet will jump to put it in view. Is there some other way I can
return the focus to the sheet without this quirk?

Thanks, Don <donwiss at panix.com.


Don Wiss

After checking control checkbox returning focus to the sheet
 
On 11 May 2004 19:23:36 -0700, (Vic Eldridge) wrote:

The checkboxes from the Forms toolbar don't take focus when clicked.
But if you must use the ActiveX checkbox,


I know this. I really dislike the ActiveX ones. But the checkbox on the
Forms toolbar, for some reason, won't move and size with cells. In this
application I need them to disappear when the section of rows they are on
is hidden.

SendKeys "{ESC}"


Okay. I'll try this when I get back into the office. Looks like a good
solution.

Don <donwiss at panix.com.


All times are GMT +1. The time now is 08:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com