From: bondjel on 22 Mar 2010 07:58 I have columns of data and recorded a macro for taking the average of every seven numerical entries. What syntax do I use to tell the macro to stop looping when it gets to a blank cell in the column?
From: Mike H on 22 Mar 2010 08:22 Hi, Post your recorded macro. -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "bondjel" wrote: > I have columns of data and recorded a macro for taking the average of every > seven numerical entries. What syntax do I use to tell the macro to stop > looping when it gets to a blank cell in the column?
From: Stefi on 22 Mar 2010 08:25 See Exit Do statement in Do ...Loop in VBA Help! -- Regards! Stefi „bondjel” ezt írta: > I have columns of data and recorded a macro for taking the average of every > seven numerical entries. What syntax do I use to tell the macro to stop > looping when it gets to a blank cell in the column?
From: bondjel on 22 Mar 2010 09:03 Mike, Here it is: Do ActiveCell.FormulaR1C1 = "=AVERAGE(R[-6]C[-1]:RC[-1])" ActiveCell.Offset(7, 0).Range("A1").Select ActiveCell.FormulaR1C1 = "=AVERAGE(R[-6]C[-1]:RC[-1])" Loop "Mike H" wrote: > Hi, > > Post your recorded macro. > -- > Mike > > When competing hypotheses are otherwise equal, adopt the hypothesis that > introduces the fewest assumptions while still sufficiently answering the > question. > > > "bondjel" wrote: > > > I have columns of data and recorded a macro for taking the average of every > > seven numerical entries. What syntax do I use to tell the macro to stop > > looping when it gets to a blank cell in the column?
From: Mike H on 22 Mar 2010 09:15 Hi, there will no doubt be some comment that selecting cells isn't the best way to do what you want but if it works for you then so be it. This selects the cell then checks for data in the cell to the left and if it's empty the loop terminates Do ActiveCell.FormulaR1C1 = "=AVERAGE(R[-6]C[-1]:RC[-1])" ActiveCell.Offset(7, 0).Range("A1").Select Loop Until ActiveCell.Offset(, -1).Value = "" -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "bondjel" wrote: > Mike, > > Here it is: > > > Do > ActiveCell.FormulaR1C1 = "=AVERAGE(R[-6]C[-1]:RC[-1])" > ActiveCell.Offset(7, 0).Range("A1").Select > ActiveCell.FormulaR1C1 = "=AVERAGE(R[-6]C[-1]:RC[-1])" > Loop > > "Mike H" wrote: > > > Hi, > > > > Post your recorded macro. > > -- > > Mike > > > > When competing hypotheses are otherwise equal, adopt the hypothesis that > > introduces the fewest assumptions while still sufficiently answering the > > question. > > > > > > "bondjel" wrote: > > > > > I have columns of data and recorded a macro for taking the average of every > > > seven numerical entries. What syntax do I use to tell the macro to stop > > > looping when it gets to a blank cell in the column?
|
Next
|
Last
Pages: 1 2 Prev: Protection Next: Connect a number to a picture bank and import that picture to exce |