How to automate the process of finding the highest number in a dynamic range meeting a criteria?
New data added/updated every day (new come, old gone).
The attached file has a properly displayed data.
Thanks,
hmgrts
How to automate the process of finding the highest number in a dynamic range meeting a criteria?
New data added/updated every day (new come, old gone).
The attached file has a properly displayed data.
Thanks,
hmgrts
Last edited by hmgrts; 07-09-2009 at 02:21 PM.
Give this macro a try. Be sure to remove those notes off to the right or it will interfere with the "find" commands.
Please Login or Register to view this content.
Last edited by JBeaucaire; 07-08-2009 at 03:05 PM. Reason: Removed the LOOP, replaced with a single MAX calculation
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
?None of us is as good as all of us? - Ray Kroc
?Actually, I *am* a rocket scientist.? - JB (little ones count!)
Thank you very much JBeaucaire.
I'm getting "Run-time error '91': Object veriable or With block variable not set" If I'm changing
toPlease Login or Register to view this content.
How to fix it?Please Login or Register to view this content.
Thanks,
hmgrts
Repost your sheet with the corrected data and your corrected needs, I'll take a look.
Here is sheet with corrected data:
1) You have the macro in the wrong place. In the VBEditor, click on INSERT > MODULE and place the regular macro into a regular module.
2) Put the code back exactly the way it was when I gave it to you. It works fine with this data, too. The 15:00 is a visual number format, it's still 3:00:00 PM in the cell, so the macro can find the 3:00 just fine.
3) Make sure you remove all the "notes" you put in off to the right, they WILL interfere with the macro.
Yes, macro can find the 3:00 PM just fine but it's also picking 3:00 AM.2) Put the code back exactly the way it was when I gave it to you. It works fine with this data, too. The 15:00 is a visual number format, it's still 3:00:00 PM in the cell, so the macro can find the 3:00 just fine.
The first data set had only 3:00 AM, and the macro works great.
The second data set had only 3:00 PM and the macro works as designed.
Is there a reason you haven't simply presented a dataset with ALL the parameters and times needing to be dealt with and supplied sample results from that data?
I wanted to simplify.
This is file with all the parameters and times:
Ah, ok, simple enough. Just change the 3:00 to 3:00:00 AM and it will return to expected operation.
It's always best to work with the actual data instead of simplified versions. From our point of view, we presume you are presenting all the parameters and our suggestions/methods are affected...and may be incorrect based on what you might have left out.Please Login or Register to view this content.
Anyway, this is good to go, yes? If that takes care of your need, be sure to EDIT your original post, click Go Advanced and mark the PREFIX box [SOLVED].
(Also, use the blue "scales" icon in our posts to leave Reputation Feedback, it is appreciated)
Yes, this is good. Thank you!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks