avanura007
New Member
- Joined
- Aug 12, 2014
- Messages
- 1
Hi, I have looked everywhere for this, but couldn't find my exact problem.
I have a listbox, with values 1 through 10. On selecting a value, I have a macro assigned to the listbox where am picking up the value from the target cell and hiding/unhiding an equal number of rows. It is a FORM CONTROL listbox.
I also have a reset button on pressing which, I am erasing the target cell of the listbox, thus setting it to null.
Problem is, in such a condition, if I directly press the arrow button, then the macro is being triggered, and the whole code is going into an infinite loop, and excel is hanging.
If I select a value from the listbox first (thereby populating the target cell), then scroll using the arrow keys, then select another value, then the code is working fine.
Is there any way to trigger the code by selection of a value only and NOT when the arrows in the listbox are pressed?
I am using EXCEL 2010.
I have a listbox, with values 1 through 10. On selecting a value, I have a macro assigned to the listbox where am picking up the value from the target cell and hiding/unhiding an equal number of rows. It is a FORM CONTROL listbox.
I also have a reset button on pressing which, I am erasing the target cell of the listbox, thus setting it to null.
Problem is, in such a condition, if I directly press the arrow button, then the macro is being triggered, and the whole code is going into an infinite loop, and excel is hanging.
If I select a value from the listbox first (thereby populating the target cell), then scroll using the arrow keys, then select another value, then the code is working fine.
Is there any way to trigger the code by selection of a value only and NOT when the arrows in the listbox are pressed?
I am using EXCEL 2010.