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

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
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,494
Messages
6,113,974
Members
448,537
Latest member
Et_Cetera

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