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

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
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,213,549
Messages
6,114,264
Members
448,558
Latest member
aivin

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