Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

1 view
Skip to first unread message

mswisher

unread,
Nov 24, 2009, 9:25:03 AM11/24/09
to
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.

Susan

unread,
Nov 24, 2009, 11:18:24 AM11/24/09
to
Private Sub Commandbutton1_Click()

Dim myRange as Range
Dim myNumber as Long

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

myNumber = myNumber + 1
myRange.Value = myNumber

End Sub


susan

On Nov 24, 9:25 am, mswisher <mswis...@discussions.microsoft.com>
wrote:

Gord Dibben

unread,
Nov 24, 2009, 11:34:27 AM11/24/09
to
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

0 new messages