+ Reply to Thread
Results 1 to 6 of 6

How to find last 10 cells in a row and paste the average into new sheet

  1. #1
    Registered User
    Join Date
    07-26-2007
    Posts
    7

    How to find last 10 cells in a row and paste the average into new sheet

    Hi guys

    Trying to sort some data on seperate sheets. I have a table of data on each sheet and need to find the average value from the last 10 cells in column G on a sheet called "0.3lpm" and paste into a sheet called "comp" (which could be the active sheet).

    Thanks!!

  2. #2
    Forum Contributor boylejob's Avatar
    Join Date
    02-22-2007
    Location
    Forest City, NC
    MS-Off Ver
    2003
    Posts
    562
    banana97,

    This would be one way of doing it. Probably the hard way, but at least it will get you started.

    Please Login or Register  to view this content.
    Sincerely,
    Jeff

  3. #3
    Registered User
    Join Date
    07-26-2007
    Posts
    7
    I couldn't get that to work.

    If i just record a macro I get this:

    Please Login or Register  to view this content.
    So basically while in the active sheet (which i've called comp) I'm going to another sheet called 0.3lpm and selecting the last 10 rows of column G then doing the average.

    How can I modify the macro to automatically pick the last 10 rows in column G on sheet 0.3lpm?

    Thanks for the help!

  4. #4
    Forum Contributor boylejob's Avatar
    Join Date
    02-22-2007
    Location
    Forest City, NC
    MS-Off Ver
    2003
    Posts
    562
    banana97,

    Try this. It is setting up a formula to be placed in cell A1 on sheet Comp. It creates a formula that sums the last 10 cells of Column G and divides by it by 10.

    Please Login or Register  to view this content.
    If you want this to calculate everytime a change is made to 0.3lpm you will need to put something like this Sheet 0.3lpm object in the VB editor.

    Please Login or Register  to view this content.
    Hope this works for you

  5. #5
    Registered User
    Join Date
    07-26-2007
    Posts
    7
    Worked like a dream!

    Thank you very much!

  6. #6
    Forum Contributor boylejob's Avatar
    Join Date
    02-22-2007
    Location
    Forest City, NC
    MS-Off Ver
    2003
    Posts
    562
    Banana97,

    Great! I'm glad it worked. Creating a formula just took a little more thought on my end so answering your question ended up being a benefit to me.

    Glad I was able to help!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1