ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Price Comparison Macro - This Is For An Excel MVP (https://www.excelbanter.com/excel-discussion-misc-queries/43021-price-comparison-macro-excel-mvp.html)

Mr. Smiley

Price Comparison Macro - This Is For An Excel MVP
 
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.

Don Guillett

Gosh, if only I were an MVP, I could tell you.

--
Don Guillett
SalesAid Software

"Mr. Smiley" wrote in message
...
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.




Mike

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.


"Mr. Smiley" wrote:

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.


Amedee Van Gasse

In , 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! ;-)

--
Amedee Van Gasse

Mr. Smiley

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!!!!!!!!

"Mike" wrote:

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.


"Mr. Smiley" wrote:

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.


Mr. Smiley

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.

"Mike" wrote:

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.


"Mr. Smiley" wrote:

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.



All times are GMT +1. The time now is 07:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com