Selection Change Event Handler

The code in Listing 7.35 shows how you can write code in the Selection-Change event handler of the list object to display the address of the selected range in the status bar.

Listing 7.35. Displaying the address of a range of cells selected in the list object

Private Sub List1_SelectionChange(ByVal Target As _ Microsoft.Office.Interop.Excel.Range) _ Handles List1.SelectionChange

Dim currentRange As Excel.Range = Me.Application.Selection Application.StatusBar = currentRange.Address

End Sub

0 0

Post a comment