Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
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
Disabling click and right-click on the Picture I inserted in an Excel document [email protected] Excel Worksheet Functions 1 June 2nd 06 09:13 PM
adding macro to right mouse click menu JimB Excel Discussion (Misc queries) 1 October 31st 05 03:37 PM
Click on graph bar to execute a double-click in a pivot table cell [email protected] Charts and Charting in Excel 4 August 3rd 05 01:37 AM
adding an option to the right click menu kontiki Excel Discussion (Misc queries) 1 December 16th 04 07:06 PM
adding an option in the right click menu kontiki Excel Discussion (Misc queries) 1 December 15th 04 05:42 PM


All times are GMT +1. The time now is 09:05 AM.

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

About Us

"It's about Microsoft Excel"