Price Comparison Macro - This Is For An Excel MVP

G

Guest

I have a workbook with four sheets in it. On each of the first three sheets,
located in cells F33:F52 and N33:N52 are unit prices. The fourth sheet is
blank. I would like to know if (and how) a macro can be created that would
look at the unit price in cell F33 of Sheet 1, then compare it to the unit
price in F33 of Sheet 2 and F33 of Sheet three, decide which is the lowest,
and place it in the cell F33 of sheet 4. Then, look at the next cell (F34)
and do the same thing, etc. I am an absolute novie with VBA, but really need
this. It would make my life so much easier. Thanks.
 
G

Guest

In sheet4, F33 enter
=MIN(sheet1!F33,sheet2!F33,sheet3!F33)
Highlight the formula then highlight cells down and hit control d which
copies the formula down. If you need to fill cells up highlight those
cell...click on edit...click on Fill....click on Up.
 
A

Amedee Van Gasse

In <[email protected]>, Mike told us
an interesting story. My reply to this story is at the bottom of this
message.
In sheet4, F33 enter
=MIN(sheet1!F33,sheet2!F33,sheet3!F33)
Highlight the formula then highlight cells down and hit control d
which copies the formula down. If you need to fill cells up
highlight those cell...click on edit...click on Fill....click on Up.


You weren't supposed to answer!
You're not an MVP! ;-)
 
G

Guest

Mike, thanks for your help. I'll try it. To Don and Amedee, get over
yourselves!!!!! I only put MVP in the subject to show that I thought this
was a hard problem, not that the problem was for an actual MVP. There are
more egos in this discussion group that good help. Now be gone!!!!!!!!
 
G

Guest

Mike, your formula worked. Thanks. Let me ask you, do you know if there is
a way to incorporate within this code which sheet has the lowest price? For
example, if sheet 1, cell F33 has a value of 4 (and the cell is blue), sheet
2 F33 has a value of 3 (and the cell is red) and sheet 3 F33 has a value of 1
(and the cell is yellow), can I make it so that it puts the min value in
sheet 4 (1) and is the color of the cell, or has a column beside of it
stating which sheet the value came from? Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top