View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.newusers
Luke M Luke M is offline
external usenet poster
 
Posts: 2,722
Default a button to add 1 to a cell

I believe JBeaucaire meant the VBA sheet first. However, you just mentioned
that you are using Access, and this is the Excel newsgroup. Are you in the
right forum? If you meant Excel...

From spreadsheet, right click on sheet name, choose "view code". Paste
JBeaucaire's code there.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Ron" wrote:

I don't understand "put them into your sheet first"
I am using Access 2007 if that helps.
How do I "put" them?
Thanks again,
Ron

"JBeaucaire" wrote:


To keep from needing 150 macros, just use 3. Here are your macros, put
them into your sheet first.

Code:
--------------------
Sub Add1()
Selection.Value = Selection.Value + 1
Beep
End Sub

Sub Add5()
Selection.Value = Selection.Value + 5
Beep
End Sub

Sub Add10()
Selection.Value = Selection.Value + 10
Beep
End Sub

--------------------
Now turn on the Forms Toolbar, draw a button and select Add1 macro. Draw
another and select Add5, and the third uses Add10. Edit the text on the
buttons.

Now, the buttons will add the values noted to the currently selected
cell. If you don't like the "beeps" delete them, I thought the audible
confirmation the macro ran and the number was added was a good thing in
this situation.


--
JBeaucaire
------------------------------------------------------------------------
JBeaucaire's Profile: http://www.thecodecage.com/forumz/member.php?userid=73
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=49195