ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Trouble with Focus (https://www.excelbanter.com/excel-programming/272227-trouble-focus.html)

Alex@JPCS

Trouble with Focus
 
Hi,

I'm struggling with a sheet which has a selected row (which I want to
maintain for user visibility).

When the user selects a textbox control on the worksheet (configured to work
like a button using mousedown event), I wish it to perform a function, but
to maintain the row selection on the sheet after it has completed.

It seems that event with all the other functions disabled, selecting the
worksheet control causes a change in focus from the worksheet, and the range
selection is lost. (An cannot be reset without returning the focus to the
worksheet first?

Any help would be appreciated.
XL2000 on Windows 2000 Pro

Regards,

Alex@JPCS



BrianB

Trouble with Focus
 
Sub test()
Dim MyRange As Range
Set MyRange = Selection
'- run code
MyRange.Select
End Sub

Regards
BrianB
================================================== ===




"Alex@JPCS" wrote in message ...
Hi,

I'm struggling with a sheet which has a selected row (which I want to
maintain for user visibility).

When the user selects a textbox control on the worksheet (configured to work
like a button using mousedown event), I wish it to perform a function, but
to maintain the row selection on the sheet after it has completed.

It seems that event with all the other functions disabled, selecting the
worksheet control causes a change in focus from the worksheet, and the range
selection is lost. (An cannot be reset without returning the focus to the
worksheet first?

Any help would be appreciated.
XL2000 on Windows 2000 Pro

Regards,

Alex@JPCS



All times are GMT +1. The time now is 03:40 PM.

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