PC Review


Reply
Thread Tools Rate Thread

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

 
 
mswisher
Guest
Posts: n/a
 
      24th Nov 2009
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.



 
Reply With Quote
 
 
 
 
Susan
Guest
Posts: n/a
 
      24th Nov 2009
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:
> 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.. *


 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      24th Nov 2009
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
<(E-Mail Removed)> 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.
>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vista SP2: Stop button disabled when Send/Recv button pressed Sartre Windows Vista Mail 1 13th May 2009 02:43 AM
update a date field with the date a button is pressed on a form. =?Utf-8?B?TWFheA==?= Microsoft Access Forms 7 19th Apr 2007 08:04 AM
change toolstrip button colour when button pressed =?Utf-8?B?TWVs?= Microsoft C# .NET 3 29th Nov 2005 12:31 AM
automatically create a spinner and link it when a button is pressed jamesleggit Microsoft Excel Programming 1 31st May 2005 08:57 PM
Can't select macro button after other button is pressed C. Campbell Microsoft Excel Programming 1 30th Nov 2004 07:46 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:10 PM.