V
V
Vyacheslav Grachunov2019-03-13 23:14:03
Visual Basic
Vyacheslav Grachunov, 2019-03-13 23:14:03

How to catch an event in another Excel workbook?

Question such:
There is a book with the code on VBA. As the code executes, another workbook is created and opened. How to catch the SelectionChange event from the parent book on the sheet in the created one and write the value to the cell of the parent book?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vyacheslav Grachunov, 2019-03-13
@Qwentor

Private WithEvents App As Application

Private Sub Workbook_Open() ' открытие книги
     Set App = Application
End Sub

Private Sub App_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
    If Sh.Name = "Поиск" Then
       'Действия
    End If
End Sub

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question