1

I wrote a worksheetfunction which returns all selected items from a active x listbox with multi selection enabled.

The problem is that if selection in listbox is changed the function doesnt recalc because the listbox does not send an event. The function recalcs fine on shift+f9.

Adding application.volatile doesnt change this either.

Can I use SelectedIndexChanged to trigger a recalc of the sheet? How would I do this please?

Community
  • 1
  • 1
nik
  • 1,672
  • 2
  • 17
  • 36

1 Answers1

0

I figured it out maybe it helps others.

Private Sub listbox1_Change()
  Application.Calculate
End Sub

From the module to the sheet in vba.

But this raises the question why do a worksheetfunction in the first place... I can simply but it all in this event.

nik
  • 1,672
  • 2
  • 17
  • 36