Solved

Determine cell with greatest value

Posted on 2012-03-30
7
178 Views
Last Modified: 2012-03-31
Hello Experts,

I want my code on any worksheet_change (usedRange A1 to H20) that it determines in the Range(B1:D1) which cell has the highest numeric value.

Then
If B1 is highest then B2.value = 50
elseif C1 is highest then C2.value = 50
elseif D1 is highest then D2.value = 50
end if

This is the basis for what I need it to do - I have other steps to add after it determines the right cell.  But this will get me started and probably finished.

Can you assist please,
Thanks
0
Comment
Question by:mike637
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 37788643
MsgBox [B1:D1].Find(Application.Max([B1:D1])).Address

Kevin
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 37788648
Why don't you simply enter this formula in B2 and then copy it all the way to D2?

=IF(B1=MAX($B$1:$D$1),50,"")

This way you would not need any event macro.
0
 
LVL 81

Accepted Solution

by:
zorvek (Kevin Jones) earned 500 total points
ID: 37788657
[B1:D1].Find(Application.Max([B1:D1])).Offset(1).Value = 50

Kevin
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 26

Expert Comment

by:pony10us
ID: 37788690
Will this work:   =CELL("address",INDEX(1:1,MATCH(MAX(1:1),1:1,0)))

That will return the cell in row 1 that contains the highest value.
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 37788732
Or maybe

[B1:D1].Find(Application.Max([B1:D1])).offset(1,0).Value = 50
0
 
LVL 26

Expert Comment

by:pony10us
ID: 37788772
Here is an example of what I posted:
excel-highest.jpg
0
 

Author Comment

by:mike637
ID: 37789758
Hello Experts,

I think I am a bit brain-fried, but I was going to use it as a worksheet.change, but it needs to be on worksheet.activate.

I think I need something similair to what was proprosed in the

[B1:D1].Find(Application.Max([B1:D1])).Offset(1).Value = 50

But how do I declare this to work in a worksheet.activate situation?

Thanks Experts!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question