LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 1
Default I believe JBeaucaire meant the VBA sheet first.

Hello... This is almost exactly what I am trying to do, I have the "add 1" macro as discribed above working for one selected cell...

But I am trying to add 1 to the individual values of multiple cells when the "add 1" macro is ran. Can the code be modified to add 1 to the individual values of a predetermined group of cells? In my case it would be B2:B173...

Thank you!!!

On Monday, January 12, 2009 2:01 AM Ro wrote:


I need to create a button that will ADD 1 to a cell everytime I click it.
Actually 3 bottons (1,5,10). I will need to repeat these buttons for 50
students to their total score. I don't know if this matters. I don't mind
creating buttons as long as they're easy to program.
Help Obe Wan



On Monday, January 12, 2009 2:43 AM 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



On Monday, January 12, 2009 8:48 AM Ro wrote:


I do not 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:



On Monday, January 12, 2009 3:25 PM Luke wrote:


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:






 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Transfer cell values to another cell by selecting button. Gryndar Excel Worksheet Functions 2 November 24th 08 02:21 AM
Cell working as a button? Cell color control Emerogork via OfficeKB.com Excel Worksheet Functions 1 August 30th 07 05:20 PM
Excel - create button to replace cell content with cell value blackmot Excel Worksheet Functions 3 December 7th 05 05:10 PM
Cell as Button [email protected] Excel Discussion (Misc queries) 3 August 29th 05 01:16 AM
Using a button in a cell DaveSunsation Excel Worksheet Functions 2 December 1st 04 04:02 AM


All times are GMT +1. The time now is 02:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"