Forum Discussion

perkin_warbeck's avatar
perkin_warbeck
Brass Contributor
May 17, 2021
Solved

In VBA how can I prevent change of focus when a cell is selected?

In my VBA application, the user may click on certain chart elements (e.g., a series or a point in a series).  This triggers an EventChart_Select event. In the event handler, I select a cell on the sa...
  • mtarler's avatar
    mtarler
    May 17, 2021
    If i understand what you are doing, the reason Application.EnableEvents = False doesn't work is because that macro ends and hence EnableEvents gets turned back on and Excel will scroll. That said you can try adding ActiveWindow.ScrollRow = Range("cell where you want the window to be") before you turn EnableEvents back to True

Resources