create a button when pressed it will +1 to another field

  • Follow


Customer Survey- When a button or cell is pressed once it will add 1 to 
another existing field and every time it is pressed it will add another 1.  
										
										

0
Reply Utf 11/24/2009 2:25:03 PM

Private Sub Commandbutton1_Click()

Dim myRange as Range
Dim myNumber as Long

Set myRange =3D ActiveSheet.Range("a5") '<=3D=3D change
myNumber =3D myRange.Value

myNumber =3D myNumber + 1
myRange.Value =3D myNumber

End Sub


susan



On Nov 24, 9:25=A0am, mswisher <mswis...@discussions.microsoft.com>
wrote:
> Customer Survey- When a button or cell is pressed once it will add 1 to
> another existing field and every time it is pressed it will add another 1=
.. =A0

0
Reply Susan 11/24/2009 4:18:24 PM


Might be easiest to add a spinner from the Forms Toolbar or Control
Toolbox..

But a macro to do what you want.  Add a button and assign the macro.

Sub add_one()
With ActiveSheet.Range("A1")
      .Value = .Value + 1
End With
End Sub


Gord Dibben  MS Excel MVP

On Tue, 24 Nov 2009 06:25:03 -0800, mswisher
<mswisher@discussions.microsoft.com> wrote:

>Customer Survey- When a button or cell is pressed once it will add 1 to 
>another existing field and every time it is pressed it will add another 1.  
>										
>										

0
Reply Gord 11/24/2009 4:34:27 PM

2 Replies
178 Views

(page loaded in 0.105 seconds)

Similiar Articles:
















7/15/2012 10:38:31 PM


Reply: