+ Reply to Thread
Results 1 to 6 of 6

Insert average, minimun, and maximum values in workbook

  1. #1
    Registered User
    Join Date
    04-27-2012
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    45

    Insert average, minimun, and maximum values in workbook

    I wish to insert some key parameters such as average, minimum, and maximum values of a range G (column G) in the same ACTIVE workbook as follows. The number of rows in G may differ from file to file. All files have only one sheet, so we are concerned with the active worksheet only.

    Cell J30 Put maximum value
    Cell K30 Put cell address of max value
    Cell L30 Put Roundup of max value (roundup to nearest 10's)


    Cell J31 Put minimum value
    Cell K31 Put cell address of min value
    Cell L31 Put Rounddown of min value (rounddown to nearest EVEN whole number)

    Cell J32 Put average value

    Additionally, I would like the cell addresss of minimum. maximum, and average values to be highlighted in different colors.

    Any help to devise such a MACRO would be welcome.

  2. #2
    Valued Forum Contributor StevenM's Avatar
    Join Date
    03-23-2008
    Location
    New Lenox, IL USA
    MS-Off Ver
    2007
    Posts
    910

    Re: Insert average, minimun, and maximum values in workbook

    Please Login or Register  to view this content.
    Last edited by StevenM; 04-27-2012 at 04:01 AM.

  3. #3
    Registered User
    Join Date
    04-27-2012
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    45

    Re: Insert average, minimun, and maximum values in workbook

    Thank you StevenM for your kind reply and code. Unfortunately, sometimes the code runs ok while sometimes it shows
    Runtime error 1004
    Method 'Rows' of object '_Global' failed

    Secondly, I want the actual cell addresses of Maximum and Minimum values highlighted in the G column and not the cells K30 and K31. Sorry, my explanation was not quite clear on this.

    Kindly look up and thanks once again for your prompt reply.

  4. #4
    Registered User
    Join Date
    04-27-2012
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    45

    Re: Insert average, minimun, and maximum values in workbook

    Hi StevenM:
    I figured out why sometimes the code was not working. It was because the active sheet had a chart selected. When I deselected the chart, the code worked fine. Now just one request. Look at the second part of my querry, regarding highlighting the actual cell addresses in the column G.

    Thanks!

  5. #5
    Valued Forum Contributor StevenM's Avatar
    Join Date
    03-23-2008
    Location
    New Lenox, IL USA
    MS-Off Ver
    2007
    Posts
    910

    Re: Insert average, minimun, and maximum values in workbook

    Change the last two lines to:

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    04-27-2012
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    45

    Re: Insert average, minimun, and maximum values in workbook

    Thanks StevenM.

+ 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