+ Reply to Thread
Results 1 to 7 of 7

Capturing Individual High and Low Values of cells on multiple lines

  1. #1
    Registered User
    Join Date
    05-30-2017
    Location
    Leicester,England
    MS-Off Ver
    2007
    Posts
    3

    Capturing Individual High and Low Values of cells on multiple lines

    Hello

    I am a new member here, specifically because I am looking for help with a problem. Although from what i have seen there is loads of information and resource here so will be sticking around now that I have found the place.

    I have a need to capture the high and low values of a cell which has streaming data in it. I have found a solution from this site which is a great start in this thread https://www.excelforum.com/excel-pro...ml#post3534977

    This is good although I need to take it one step further, I need to capture the individual high and low values of a particular field over multiple rows. where as this works well with recording one cell or the high low values from a range of cells.

    I know worse case scenario I can create multiple functions, one for each row I need to record the values from, but was wondering if there was a more elegant solution, I have tried to somehow pass in the cell reference to make the variable name which stores the value unique to each row, but I have not succeeded.

    Does anyone have any ideas ?

    thanks

    J

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Capturing Individual High and Low Values of cells on multiple lines

    Quote Originally Posted by jaurdonjo View Post
    I need to capture the individual high and low values of a particular field over multiple rows.
    Can you better explain this? Perhaps an example would help?
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Capturing Individual High and Low Values of cells on multiple lines

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

    I will mock up something for you to get you started.

    You will need to use a macro and need to tell us how to start the macro.

    The crux of the problem is to use both excel and visual basic to best effect.

    These formulas will return the Min and Max values

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Formula: copy to clipboard
    Please Login or Register  to view this content.



    This Macro will update and store the values

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by mehmetcik; 06-01-2017 at 03:06 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  4. #4
    Registered User
    Join Date
    05-30-2017
    Location
    Leicester,England
    MS-Off Ver
    2007
    Posts
    3

    Re: Capturing Individual High and Low Values of cells on multiple lines

    Hello

    Thanks for the quick responses, I really appreciate the help.

    I have attached an example of what I am trying to achieve.

    column A will have values which are streaming from a separate application, column C and D are where the high and low values are stored,with a UDF I have got from another user on this forum.

    if we just focus on row 2 for the moment and enter values into "A2" you can see that the high and low values are stored in "C2" and "D2".

    the issue is when you enter a value in to "A3" it pulls a value down from row 2.

    I think this is because the variables used in the UDF are not unique to the row so when the code is called it has stored values from the other instances of the function.

    I can get around this by creating 40 individual functions and using one unique function per row but that will make maintenance a pain in the behind.

    I hope that makes more sense and the example file helps.
    Attached Files Attached Files

  5. #5
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Capturing Individual High and Low Values of cells on multiple lines

    Quote Originally Posted by jaurdonjo View Post

    I think this is because the variables used in the UDF are not unique to the row so when the code is called it has stored values from the other instances of the function.
    You are correct; the udf only works for one instance.

    This uses the Worksheet_Change event procedure.

    To install the code:
    • Right-click on the sheet tab.
    • Select View Code from the pop-up context menu.
    • Paste the code from below in the worksheet's code module.
    • Delete the UDF formulas in the High\Low columns

    Please Login or Register  to view this content.

  6. #6
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Capturing Individual High and Low Values of cells on multiple lines

    If I may, I think a simple "circular reference" formula (with iteration enabled) is an easier approach. See these two discussions:
    https://www.excelforum.com/excel-pro...-possible.html
    https://www.excelforum.com/excel-for...ging-cell.html
    The trickiest part is the MIN() function (assuming all your values are positive) because you need to initialize the cell to some large value in order to get the MIN() function to get off of the initial 0 value.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  7. #7
    Registered User
    Join Date
    05-30-2017
    Location
    Leicester,England
    MS-Off Ver
    2007
    Posts
    3

    Re: Capturing Individual High and Low Values of cells on multiple lines

    Guys

    I really appreciate both your answers they both do what I am looking to achieve.

    I have starred both answers as i will more than likely use both options in different workbooks.

    Thanks very much for taking the time to help me out, In the unlikely event that I can offer help to either of you then just let me know

    J

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] How do I insert high-low lines on 2 specific lines (out of 4)?
    By radiotower in forum Excel General
    Replies: 0
    Last Post: 01-20-2017, 02:20 AM
  2. Replies: 1
    Last Post: 05-21-2014, 10:45 AM
  3. [SOLVED] Find and replace multiple values within individual cells
    By phbeats in forum Excel General
    Replies: 3
    Last Post: 03-14-2014, 05:13 PM
  4. How to keep track of high and low values for multiple cells in a sheet
    By attienel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-04-2013, 02:53 PM
  5. Capturing Data from multiple cells to multiple tables and cells on specific dates
    By zero_eclipse in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-27-2012, 08:38 AM
  6. [SOLVED] grid lines for individual cells
    By ffffloyd in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-25-2012, 06:17 AM
  7. How to keep track of high & low values of MULTIPLE Cells ?
    By Sarangsood in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-14-2011, 11:58 PM

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