Vb.net - how to add event to multiple worksheet at once?

  • Thread starter Thread starter AU Gridlock
  • Start date Start date
A

AU Gridlock

Guest
Hi,

I have a list of worksheet names to assign to the selection change event, but after assigning only one executable sheet.

I was lost. does anyone know where I'm wrong?


Private EventDel_SelectionChange As Excel.DocEvents_SelectionChangeEventHandler

For Each ws As String In lstWorksheetEventname
EventDel_SelectionChange = New Excel.DocEvents_SelectionChangeEventHandler(AddressOf Inputstart)
AddHandler DirectCast(CLS_app.Worksheets(ws), Excel.Worksheet).SelectionChange, EventDel_SelectionChange
Next


Private Sub Inputstart(ByVal target As Range)

...

end sub


Many thanks!

Continue reading...
 
Back
Top