Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Record max and min value of cell

0

Cell A1 having value which is a summission of some cell range which changes time to time. I have to record highest and lowest value appear in cell A1 into cell B1 and C1. Need macro or formula for this task.

Answer
Discuss

Discussion

HI Spidermaxx and welcome to the Forum

What causes A1 to change? A manual change made to the cell range you refer to?

Please EDIT your original question to explain that and use the "Add Files..." button to attach a representaive Excel file.
John_Ru (rep: 6142) Oct 30, '21 at 4:58 am
Add to Discussion

Answers

0
Selected Answer

HI Spidermaxx ,

Just like John has said, having a sample file makes it easier for us to help you. 

With that being said, I took a stab at guessing what it is that you are looking to achieve. I have attached the workbook I made which possibly answers your question.

First, in your file, you will need to add a Worksheet_Activate() macro to the worksheet where "A1", "B1", & "C1" live.

Then, in your file, you wil need to insert a module to your project and insert a macro similar to the one I wrote.

In my sample file (Excel 2007), "A2:A6" on Sheet2 is summed and entered to "A1" on Sheet1.

Give it a try; on Sheet2 change one or more values, then select Sheet1 to see the result.

Cheers,

Discuss

Discussion

Willie

Nice one. Your macro neatly records the highest and lowest viewed values of A1 (in B1 and C1 respectively).

That wasn't quite how I read the question... if A1 is 542 and the values in sheet2 change and sum to higher or lower values (say 1000  and 0) but sheet1 wasn't veiwed, they can be changed back without those 1000 and  0 "peak" values being recorded.

There's another solution which would record those peaks but hopefully your macro does what Spedermaxx wants. A sample file would help  as we said (not least to chnage my veiw that this feels a bit like a school work question).
John_Ru (rep: 6142) Oct 31, '21 at 4:21 am
Hi Willie
You got it exactly n solved my problem. Thanks, thanks a lot.
Keep it up helping. Blessingssss.....

Hey John
Thanks a lot bro for your intrest and response.
Spidermaxx (rep: 2) Nov 1, '21 at 12:46 am
Spidermaxx

I'm glad that Willie's Answer solved your problem. Under the rules of the Forum you should now mark the Answer as Selected - this acknowledges Willie's effort and guides other users with similar problems.
John_Ru (rep: 6142) Nov 1, '21 at 2:57 am
Yes Done.
Spidermaxx (rep: 2) Nov 1, '21 at 2:53 pm
Thanks
John_Ru (rep: 6142) Nov 1, '21 at 3:58 pm
Add to Discussion


Answer the Question

You must create an account to use the forum. Create an Account or Login