Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Diane Collins   on Nov 21 In MS Office Category.

  
Question Answered By: Laurel Collins   on Nov 21

I managed to add moving average functionality and
an ability to end the script  on an empty cell  instead of the
arbitrary 3500 loop count.

I couldn't figure out how to sum across a range though. How do you do
this?

I sure wished I installed the vba help files before I misplaced my
installation CD...

Application.ScreenUpdating = False

x = Selection.Cells.Column
y = Selection.Cells.Row

Do Until Len(Cells(y, x)) = 0

Cells(y, x).Value = (Cells(y, x).Value + Cells(y + 1, x).Value +
Cells(y + 2, x).Value + Cells(y + 3, x).Value) / 4

Range(Cells(y + 1, x), Cells(y + 3, x)).Delete shift:=xlUp

y = y + 1

Loop


Application.ScreenUpdating = True

Share: 

 

This Question has 7 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on how are cell coordinates referenced on a clicked cell Or get search suggestion and latest updates.


Tagged: