Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Mr. Smiley
 
Posts: n/a
Default 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.
  #3   Report Post  
Mike
 
Posts: n/a
Default

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.

  #4   Report Post  
Amedee Van Gasse
 
Posts: n/a
Default

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
  #5   Report Post  
Mr. Smiley
 
Posts: n/a
Default

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.



  #6   Report Post  
Mr. Smiley
 
Posts: n/a
Default

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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving Excel using Macro mrbalaje Excel Discussion (Misc queries) 4 April 20th 05 02:32 PM
Button fails to call macro when open an Excel via Intranet tigertax Excel Discussion (Misc queries) 1 April 12th 05 10:21 AM
How can I edit cell contents with a macro in Excel? NotAnExpert Excel Discussion (Misc queries) 1 March 23rd 05 01:17 AM
Problem Editing Macro in Shared Excel File [email protected] Excel Discussion (Misc queries) 0 March 19th 05 06:01 PM
Macro in Excel 2002 to save a workbook to a FTP location Lloyd Excel Discussion (Misc queries) 0 December 21st 04 02:49 PM


All times are GMT +1. The time now is 08:26 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"