Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to Find the Max ?

I need a macro to find a max value for range of cells and also the value of the cell adjacent to max cell.
i should input the range while running the macro.

kindly help me in this ...


Submitted via EggHeadCafe - Software Developer Portal of Choice
EggheadCafe Stock Quote WebService
http://www.eggheadcafe.com/tutorials...k-quote-w.aspx
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to Find the Max ?


You can use the worksheet function max and then search for the value
using Find like this


Set MyRange = Range("a1:a100")
MaxVal = worksheetfunction.max(MyRange)
Set C = MyRange.find(what:=MaxVal,lookin:=xlvalues,lookat: =xlwhole)
AdjacentValue = C.offset(0,1)


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=167026

Microsoft Office Help

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Macro to Find the Max ?

=INDEX(B1:B100,MATCH(MAX(A1:A100),A1:A100,0),1)

where the range you want to search Max is A1:A100 and you want to return the
cell in B1:B100.

Regards,
Peter T

<Anandh R wrote in message ...
I need a macro to find a max value for range of cells and also the value of
the cell adjacent to max cell.
i should input the range while running the macro.

kindly help me in this ...


Submitted via EggHeadCafe - Software Developer Portal of Choice
EggheadCafe Stock Quote WebService
http://www.eggheadcafe.com/tutorials...k-quote-w.aspx



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
macro that does a find and then find next Galway[_2_] Excel Programming 1 January 1st 09 08:10 PM
Find & Replace and Find & Insert macro help needed RS Excel Programming 2 January 29th 07 07:35 AM
Get Macro warning, but can't find Macro Stilla Excel Worksheet Functions 1 January 20th 07 01:27 AM
change error message when no more for "find" in macro to find swyltm Excel Programming 1 January 13th 06 05:16 PM
I need to find a macro to find data cut and paste to another colu. Rex Excel Programming 6 December 7th 04 09:22 AM


All times are GMT +1. The time now is 12:19 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"