Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default ADD (A3+A1) IN MS EXCEL & I WANT OUTPUT IN CELL A3 HOW ?

Dear ALL,



I want a macro for following scene...plz help any body...



I HAVE TWO VALUES IN CELL:A1 & CELL:A3

NOW I WANT ADD THE TWO VALUES IN THE SAME CELL A3 & IF I CHANGE THE VALUE IN
A1 THEN THAT VALUE TO BEE ADDED TO A3 VALUE(MEANS A3+A1) & SAME ......

HOW IT POSSIBLE PLZ GUIDE ME.

EX:

A1=6,A3=3

NOW I WANT IN A3=9

IF I CHANGED IN A1(A3 HAVING 9 ONLY) MEANS NOW A1=10

THEN A3 BECOMES 9+10 MEANS A3=19.& SAME CONTNUIOUS HOW IT POSSIBLE.....
--
seshu
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default ADD (A3+A1) IN MS EXCEL & I WANT OUTPUT IN CELL A3 HOW ?

Put the following event macro in the worksheet code area:

Private Sub Worksheet_Change(ByVal Target As Range)
Set t = Target
Set a1 = Range("A1")
If Intersect(t, a1) Is Nothing Then Exit Sub
Application.EnableEvents = False
a1.Offset(2, 0).Value = a1.Offset(2, 0).Value + a1.Value
Application.EnableEvents = True
End Sub

as you change the value in A1, it will automatically be aded to the value in
A3.

Because it is worksheet code, it is very easy to install and automatic to use:

1. right-click the tab name near the bottom of the Excel window
2. select View Code - this brings up a VBE window
3. paste the stuff in and close the VBE window

If you have any concerns, first try it on a trial worksheet.

If you save the workbook, the macro will be saved with it.


To remove the macro:

1. bring up the VBE windows as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

To learn more about Event Macros (worksheet code), see:

http://www.mvps.org/dmcritchie/excel/event.htm

--
Gary''s Student - gsnu200909


"seshuramakrishna" wrote:

Dear ALL,



I want a macro for following scene...plz help any body...



I HAVE TWO VALUES IN CELL:A1 & CELL:A3

NOW I WANT ADD THE TWO VALUES IN THE SAME CELL A3 & IF I CHANGE THE VALUE IN
A1 THEN THAT VALUE TO BEE ADDED TO A3 VALUE(MEANS A3+A1) & SAME ......

HOW IT POSSIBLE PLZ GUIDE ME.

EX:

A1=6,A3=3

NOW I WANT IN A3=9

IF I CHANGED IN A1(A3 HAVING 9 ONLY) MEANS NOW A1=10

THEN A3 BECOMES 9+10 MEANS A3=19.& SAME CONTNUIOUS HOW IT POSSIBLE.....
--
seshu

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,624
Default ADD (A3+A1) IN MS EXCEL & I WANT OUTPUT IN CELL A3 HOW ?

See:

http://www.mcgimpsey.com/excel/accumulator.html

Note that you don't need a macro...


In article ,
seshuramakrishna wrote:

I want a macro for following scene...plz help any body...

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
How to use an integral for cell output value. Corribus Excel Discussion (Misc queries) 4 December 16th 09 08:39 PM
how do I output result of formula to another cell? Francois Excel Discussion (Misc queries) 3 November 24th 06 03:02 PM
How to output the left most cell? Morrigan Excel Discussion (Misc queries) 8 January 24th 06 02:35 PM
How do I output the worksheet name in cell? Sloth Excel Discussion (Misc queries) 3 July 8th 05 11:04 PM
PDF output with Cell as filename Scott Zierler Excel Worksheet Functions 2 June 30th 05 02:42 PM


All times are GMT +1. The time now is 07:20 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"