TSon

Hello everybody
I create a addin for excel 2003 by using vsto. How can I detect a row is selected or not
Thank you



Re: Visual Studio Tools for Office How to detect a row is selected

Dennis Wallentin

Hi,

The following event procedure can be used (which is created in the ThisAddin.VB module):

Code Snippet

Private Sub Application_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Microsoft.Office.Interop.Excel.Range) Handles Application.SheetSelectionChange

Dim TargetRow As Integer = 4

If Application.ActiveCell.Row = 4 Then

MessageBox.Show("Row 4 is active")

Else

MessageBox.Show("Some other row is active")

End If

End Sub