Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Return a row with the Min or Max funtion

Assume rng is a reference to a single row

Sub FindMinColumn()
Dim rng As Range, rng1 As Range, ans As Variant
Set rng = Rows(3).Cells
ans = Application.Match(Application.Min(rng), rng, 0)
If Not IsError(res) Then
Set rng1 = rng(1, ans)
MsgBox rng1.Column
Else
MsgBox "Problems"
End If

End Sub

--
Regards,
Tom Ogilvy


"Adam" wrote in message
...
Is there a way to return the column where the min or max exists rather

than
returning the min or max? I am using WorksheetFunction.Min. Thank you

very
much.



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
What funtion to use? fetzer New Users to Excel 2 November 3rd 09 02:55 PM
If Funtion David Excel Worksheet Functions 4 November 29th 05 08:09 PM
If funtion help fetzer New Users to Excel 5 July 3rd 05 07:02 PM
IF funtion viddom Excel Discussion (Misc queries) 2 June 30th 05 02:53 PM
AutoSave Funtion In VBA Celtic_Avenger[_36_] Excel Programming 0 September 15th 04 10:56 PM


All times are GMT +1. The time now is 11:47 PM.

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

About Us

"It's about Microsoft Excel"