Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding + 1 on each click.
Ok, I'm new to excel and excel macros, however I am a programmer b trade (C++) and I know enough VB to do the above in a standalone V program, however in excel I'm lost. I've created a macro to add +1 eachtime to a sell when I click button, but all it does is change the actual cell to 1 instead o adding 1 eachtime. So basically, how can I achieve the +1 been added all the time i Excel? In C++ for example you could just have something like (off the top o my head) #include <stdio.h #include <iostream.h main() { int loop; int total = 0; int number = 0; for (loop = 1; loop <= 5; loop++) { cout << "Please enter a number : "; cin number; total += number; } cout << endl << "The total is : " << total; char.get(); return(0); ----------------------------------------------- ~~ Message posted from http://www.ExcelTip.com ~~View and post usenet messages directly from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding + 1 on each click.
Try this
Range("A1").Value = Range("A1").Value + 1 -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "Nilrem" wrote in message ... Ok, I'm new to excel and excel macros, however I am a programmer by trade (C++) and I know enough VB to do the above in a standalone VB program, however in excel I'm lost. I've created a macro to add +1 eachtime to a sell when I click a button, but all it does is change the actual cell to 1 instead of adding 1 eachtime. So basically, how can I achieve the +1 been added all the time in Excel? In C++ for example you could just have something like (off the top of my head) #include <stdio.h #include <iostream.h main() { int loop; int total = 0; int number = 0; for (loop = 1; loop <= 5; loop++) { cout << "Please enter a number : "; cin number; total += number; } cout << endl << "The total is : " << total; char.get(); return(0); } ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding + 1 on each click.
Thanks a lot I'll give it a whirl ----------------------------------------------- ~~ Message posted from http://www.ExcelTip.com ~~View and post usenet messages directly from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Disabling click and right-click on the Picture I inserted in an Excel document | Excel Worksheet Functions | |||
adding macro to right mouse click menu | Excel Discussion (Misc queries) | |||
Click on graph bar to execute a double-click in a pivot table cell | Charts and Charting in Excel | |||
adding an option to the right click menu | Excel Discussion (Misc queries) | |||
adding an option in the right click menu | Excel Discussion (Misc queries) |