![]() |
Please help - Spin Button
Dear Experts,
Can you please help me to write the code for the following. In Cell "A1" I have a value, e.g. 3 In Cell "B1" I have an equation with the value in "A1", e.g. =SQRT("A1"^2+2.5*"A1"-1.4) I also have a Spin Button that I want to use to increase SpinButton1_SpinUp() or decrease SpinButton1_SpinUp() the value in A1 with an increment of 1 every time I click Up or Down so that the calculation in B1 would change. But I want this value to be saved in A1 as well when I exit Excel and open again. Thanks a lot! Cheers, Ginger |
Please help - Spin Button
You formula is correct expect you do not need quotes
=SQRT(A1^2+2.5*A1-1.4) Do you have the spin button working? Excel will keep whatever value is in A1 at the time you issue the Save command best wishes -- Bernard V Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme remove caps from email "the nomad" < wrote in message ... Dear Experts, Can you please help me to write the code for the following. In Cell "A1" I have a value, e.g. 3 In Cell "B1" I have an equation with the value in "A1", e.g. =SQRT("A1"^2+2.5*"A1"-1.4) I also have a Spin Button that I want to use to increase SpinButton1_SpinUp() or decrease SpinButton1_SpinUp() the value in A1 with an increment of 1 every time I click Up or Down so that the calculation in B1 would change. But I want this value to be saved in A1 as well when I exit Excel and open again. Thanks a lot! Cheers, Ginger |
Please help - Spin Button
Bernard,
Thank you for you reply. I put the quotes just to emphasize that it is referenced to A1. Could you please help me with the code when I press up button on Spin Button, the value in A1 increases by one, and the opposite - if I press down button, the value decreases by 1, so the calculation of f(x) equation in B1 will be based on a new x value in A1. Thanks a lot! Ginger ~~~ great minds think alike "Bernard Liengme" wrote in message ... You formula is correct expect you do not need quotes =SQRT(A1^2+2.5*A1-1.4) Do you have the spin button working? Excel will keep whatever value is in A1 at the time you issue the Save command best wishes -- Bernard V Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme remove caps from email "the nomad" < wrote in message ... Dear Experts, Can you please help me to write the code for the following. In Cell "A1" I have a value, e.g. 3 In Cell "B1" I have an equation with the value in "A1", e.g. =SQRT("A1"^2+2.5*"A1"-1.4) I also have a Spin Button that I want to use to increase SpinButton1_SpinUp() or decrease SpinButton1_SpinUp() the value in A1 with an increment of 1 every time I click Up or Down so that the calculation in B1 would change. But I want this value to be saved in A1 as well when I exit Excel and open again. Thanks a lot! Cheers, Ginger |
Please help - Spin Button
This should get you started...
Option Explicit Private Sub SpinButton1_SpinDown() ' If "A1" is Greater then 0 the "A1"-1 With Range("a1") If .Value "0" Then .Value = .Value - 1 ElseIf .Value <= "0" Then ' if 0 then do nothing Exit Sub End If End With End Sub Private Sub SpinButton1_SpinUp() ' If "A1" is Greater then 0 "a1" + 1 With Range("a1") If .Value "0" Then .Value = .Value + 1 ElseIf .Value <= "0" Then ' If 0 then do nothing Exit Sub End If End With End Sub "the nomad" wrote: Bernard, Thank you for you reply. I put the quotes just to emphasize that it is referenced to A1. Could you please help me with the code when I press up button on Spin Button, the value in A1 increases by one, and the opposite - if I press down button, the value decreases by 1, so the calculation of f(x) equation in B1 will be based on a new x value in A1. Thanks a lot! Ginger ~~~ great minds think alike "Bernard Liengme" wrote in message ... You formula is correct expect you do not need quotes =SQRT(A1^2+2.5*A1-1.4) Do you have the spin button working? Excel will keep whatever value is in A1 at the time you issue the Save command best wishes -- Bernard V Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme remove caps from email "the nomad" < wrote in message ... Dear Experts, Can you please help me to write the code for the following. In Cell "A1" I have a value, e.g. 3 In Cell "B1" I have an equation with the value in "A1", e.g. =SQRT("A1"^2+2.5*"A1"-1.4) I also have a Spin Button that I want to use to increase SpinButton1_SpinUp() or decrease SpinButton1_SpinUp() the value in A1 with an increment of 1 every time I click Up or Down so that the calculation in B1 would change. But I want this value to be saved in A1 as well when I exit Excel and open again. Thanks a lot! Cheers, Ginger |
Please help - Spin Button
It is so amazing when it works! Are you sure you are Office Novice? :))
Thanks a lot Ginger "Office_Novice" wrote in message ... This should get you started... Option Explicit Private Sub SpinButton1_SpinDown() ' If "A1" is Greater then 0 the "A1"-1 With Range("a1") If .Value "0" Then .Value = .Value - 1 ElseIf .Value <= "0" Then ' if 0 then do nothing Exit Sub End If End With End Sub Private Sub SpinButton1_SpinUp() ' If "A1" is Greater then 0 "a1" + 1 With Range("a1") If .Value "0" Then .Value = .Value + 1 ElseIf .Value <= "0" Then ' If 0 then do nothing Exit Sub End If End With End Sub "the nomad" wrote: Bernard, Thank you for you reply. I put the quotes just to emphasize that it is referenced to A1. Could you please help me with the code when I press up button on Spin Button, the value in A1 increases by one, and the opposite - if I press down button, the value decreases by 1, so the calculation of f(x) equation in B1 will be based on a new x value in A1. Thanks a lot! Ginger ~~~ great minds think alike "Bernard Liengme" wrote in message ... You formula is correct expect you do not need quotes =SQRT(A1^2+2.5*A1-1.4) Do you have the spin button working? Excel will keep whatever value is in A1 at the time you issue the Save command best wishes -- Bernard V Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme remove caps from email "the nomad" < wrote in message ... Dear Experts, Can you please help me to write the code for the following. In Cell "A1" I have a value, e.g. 3 In Cell "B1" I have an equation with the value in "A1", e.g. =SQRT("A1"^2+2.5*"A1"-1.4) I also have a Spin Button that I want to use to increase SpinButton1_SpinUp() or decrease SpinButton1_SpinUp() the value in A1 with an increment of 1 every time I click Up or Down so that the calculation in B1 would change. But I want this value to be saved in A1 as well when I exit Excel and open again. Thanks a lot! Cheers, Ginger |
Please help - Spin Button
If you used a Form spinner (not Control) you could link it to A1 without
code Want me to send you a file? best wishes -- Bernard Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme "the nomad" wrote in message ... Bernard, Thank you for you reply. I put the quotes just to emphasize that it is referenced to A1. Could you please help me with the code when I press up button on Spin Button, the value in A1 increases by one, and the opposite - if I press down button, the value decreases by 1, so the calculation of f(x) equation in B1 will be based on a new x value in A1. Thanks a lot! Ginger ~~~ great minds think alike "Bernard Liengme" wrote in message ... You formula is correct expect you do not need quotes =SQRT(A1^2+2.5*A1-1.4) Do you have the spin button working? Excel will keep whatever value is in A1 at the time you issue the Save command best wishes -- Bernard V Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme remove caps from email "the nomad" < wrote in message ... Dear Experts, Can you please help me to write the code for the following. In Cell "A1" I have a value, e.g. 3 In Cell "B1" I have an equation with the value in "A1", e.g. =SQRT("A1"^2+2.5*"A1"-1.4) I also have a Spin Button that I want to use to increase SpinButton1_SpinUp() or decrease SpinButton1_SpinUp() the value in A1 with an increment of 1 every time I click Up or Down so that the calculation in B1 would change. But I want this value to be saved in A1 as well when I exit Excel and open again. Thanks a lot! Cheers, Ginger |
Please help - Spin Button
Bernard,
As I am learning now, I would appreciate it. Cheers, Ginger "Bernard Liengme" wrote in message ... If you used a Form spinner (not Control) you could link it to A1 without code Want me to send you a file? best wishes -- Bernard Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme "the nomad" wrote in message ... Bernard, Thank you for you reply. I put the quotes just to emphasize that it is referenced to A1. Could you please help me with the code when I press up button on Spin Button, the value in A1 increases by one, and the opposite - if I press down button, the value decreases by 1, so the calculation of f(x) equation in B1 will be based on a new x value in A1. Thanks a lot! Ginger ~~~ great minds think alike "Bernard Liengme" wrote in message ... You formula is correct expect you do not need quotes =SQRT(A1^2+2.5*A1-1.4) Do you have the spin button working? Excel will keep whatever value is in A1 at the time you issue the Save command best wishes -- Bernard V Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme remove caps from email "the nomad" < wrote in message ... Dear Experts, Can you please help me to write the code for the following. In Cell "A1" I have a value, e.g. 3 In Cell "B1" I have an equation with the value in "A1", e.g. =SQRT("A1"^2+2.5*"A1"-1.4) I also have a Spin Button that I want to use to increase SpinButton1_SpinUp() or decrease SpinButton1_SpinUp() the value in A1 with an increment of 1 every time I click Up or Down so that the calculation in B1 would change. But I want this value to be saved in A1 as well when I exit Excel and open again. Thanks a lot! Cheers, Ginger |
Please help - Spin Button
Bernard,
I did some "research" and found it myself, much easier than what I thought... Thank you for the idea!!! Regards, Ginger "the nomad" wrote in message ... Bernard, As I am learning now, I would appreciate it. Cheers, Ginger "Bernard Liengme" wrote in message ... If you used a Form spinner (not Control) you could link it to A1 without code Want me to send you a file? best wishes -- Bernard Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme "the nomad" wrote in message ... Bernard, Thank you for you reply. I put the quotes just to emphasize that it is referenced to A1. Could you please help me with the code when I press up button on Spin Button, the value in A1 increases by one, and the opposite - if I press down button, the value decreases by 1, so the calculation of f(x) equation in B1 will be based on a new x value in A1. Thanks a lot! Ginger ~~~ great minds think alike "Bernard Liengme" wrote in message ... You formula is correct expect you do not need quotes =SQRT(A1^2+2.5*A1-1.4) Do you have the spin button working? Excel will keep whatever value is in A1 at the time you issue the Save command best wishes -- Bernard V Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme remove caps from email "the nomad" < wrote in message ... Dear Experts, Can you please help me to write the code for the following. In Cell "A1" I have a value, e.g. 3 In Cell "B1" I have an equation with the value in "A1", e.g. =SQRT("A1"^2+2.5*"A1"-1.4) I also have a Spin Button that I want to use to increase SpinButton1_SpinUp() or decrease SpinButton1_SpinUp() the value in A1 with an increment of 1 every time I click Up or Down so that the calculation in B1 would change. But I want this value to be saved in A1 as well when I exit Excel and open again. Thanks a lot! Cheers, Ginger |
All times are GMT +1. The time now is 12:02 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com