Results 1 to 3 of 3

VBA Average Calculation after userform input

This is a discussion on VBA Average Calculation after userform input within the Excel Questions forums, part of the Question Forums category; Hi, I am new to this forum so apologies for any non conformity. I have tried searching the web for ...

  1. #1
    New Member
    Join Date
    Jun 2010
    Posts
    2

    Default VBA Average Calculation after userform input

    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

  2. #2
    Board Regular
    Join Date
    Nov 2009
    Posts
    4,764

    Default Re: VBA Average Calculation after userform input

    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))

  3. #3
    New Member
    Join Date
    Jun 2010
    Posts
    2

    Default Re: VBA Average Calculation after userform input

    Thats great, thankyou very much for your help with this, much appreciated!

    RxFx20

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


DMCA.com