I have, for example, a drop-down list (Combo Box, not a cell with data verification).
There is the following code:
Sub DropDown_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) If ActiveSheet.ComboBox1.TopIndex > -1 Then Dim curIndex As Integer curIndex = ComboBox1.TopIndex + Application.WorksheetFunction.RoundDown(Y / 13.5, 0) curValue = ComboBox1.List(curIndex) Range("G1").Value = curValue End If End Sub How can I correctly attach this function to an element? Tried via 'Assign Macro', but Excel seems to think that only click events are assigned through this button. Or do I need to replace DropDown with the element name? If so, how can I get the name of the item?