VBA Average Calculation after userform input

RxFx10

New Member
Joined
Jun 29, 2010
Messages
2
Hi, I am new to this forum so apologies for any non conformity. I have tried searching the web for an answer to this but I cannot come up with something.

I have a user form for entering data into a worksheet, the form identifies where the first blank cell in the column (say column A) is and adds the data into this, say there are fifty entries within this column add the user form adds the 51st - I am trying to take an average for the last 30 entries that moves with each entry and the average is inserted into a cell, say C1.

I hope this makes sense, and I would be very grateful for any help anyone could offer.

Cheers

RxFx10
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
I don't know how your code refers to the cell in column A that you write to so I'm using selection here instead, being a single cell in column A:
range("C1").value=application.average(selection.resize(30).offset(-29))
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,269
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top