I have a UserForm which displays additional information based on the selection made on the worksheet.
The procedure which calls the Userform is in the worksheet module and the trigger is the Worksheet_SelectionChange
. The form is modeless so that the user can select a different cell on the worksheet. The form with the data is shown.
The problem is that the Userform takes focus away from the Excel application so that the arrow keys do not function. And since the trigger is a Worksheet_SelectionChange
event, it always takes focus after a selection change.
How do I set the focus back from the Userform or prevent the Userform from taking focus in the first place?
I've looked at the Application properties to regain focus and the Userform properties to remove focus from the Userform but can't figure it out.
I would typically use:
AppActivate Application.Caption