From: seshuramakrishna on 24 Jan 2010 12:52 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
From: Gary''s Student on 24 Jan 2010 13:10 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
From: JE McGimpsey on 24 Jan 2010 15:48 See: http://www.mcgimpsey.com/excel/accumulator.html Note that you don't need a macro... In article <37CB4893-E607-4390-90AD-ABC60FEBA210(a)microsoft.com>, seshuramakrishna <seshuramakrishna(a)discussions.microsoft.com> wrote: > I want a macro for following scene...plz help any body...
|
Pages: 1 Prev: Page Layout - Orientation - Landscape Next: How do I copy the wording of a cell into a tab? |