Excel/Count Clicks of Spin Buttons
QUESTION: Hi Edward,
I have inserted a scroll Bar in excel sheet.
I gave Cell Link of that button to A1 by right clicking on it then format control.
So now when I Click on Up Arrow, Number increases and when I Click down Arrow, Number decreases.
Can I set a counter in Cell A2 that counts How many times I have clicked the button?
ANSWER: (question found in question pool)
you will need to use some VBA to do this, but that's fairly easy - in design mode, right click the control and select view code. Enter this
Range("A2").Value = Range("A2").Value + 1
in the spinbutton change event - it will then count one for every time the button is clicked in either direction.
---------- FOLLOW-UP ----------
QUESTION: Hi Aidan,
Thanks for picking up my question.
I am New to VBA.
Can you explain step-by-step.
I can try to do it step by step, though I did think I more or less had! Developer ribbon, then use the design mode button to get the controls into design. Right click the spin button control and you will have a view code option - left click that - it will put you into the change event of the control automatically, so you then just need to paste (or type!) my code in - which simply says put into A2 whatever you find in A2 plus 1
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here