Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Finding max value

Hi all,
I have a spreadsheet with laods data in. In coloum b I have numbers, I want
to find the higest number in that coloum. Once it has found this number I
then want it to offset one cross to coloum a then give me msgbox saying the
value of that cell in coloum a.

What best way to do this

many thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default Finding max value

Try this:

Sub test()
MaxVal = Application.WorksheetFunction.Max(Range("B:B"))
Set rng = Range("B:B").Find(MaxVal)
MsgBox rng.Offset(0, -1).Value
End Sub

--
Dan

On Jan 3, 3:25*pm, millwalll
wrote:
Hi all,
I have a spreadsheet with laods data in. In coloum b I have numbers, I want
to find the higest number in that coloum. Once it has found this number I
then want it to offset one cross to coloum a then give me msgbox saying the
value of that cell in coloum a.

What best way to do this

many thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Finding max value

One way
Sub findmaxoffset()
msgbox Cells(Columns(2).Find(Application.Max(Columns(2))) .Row, 1)
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"millwalll" wrote in message
...
Hi all,
I have a spreadsheet with laods data in. In coloum b I have numbers, I
want
to find the higest number in that coloum. Once it has found this number I
then want it to offset one cross to coloum a then give me msgbox saying
the
value of that cell in coloum a.

What best way to do this

many thanks


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Finding max value

thanks is there also way you can do it like loop wher it be sumthing like this
dim maxval as interger
maxval = 0
then loop thought each cell and compaire the value of each sell with the
value of maxval if it is great replace if not leave it.

"Don Guillett" wrote:

One way
Sub findmaxoffset()
msgbox Cells(Columns(2).Find(Application.Max(Columns(2))) .Row, 1)
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"millwalll" wrote in message
...
Hi all,
I have a spreadsheet with laods data in. In coloum b I have numbers, I
want
to find the higest number in that coloum. Once it has found this number I
then want it to offset one cross to coloum a then give me msgbox saying
the
value of that cell in coloum a.

What best way to do this

many 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
Finding the first value that is less than zero russhess8 Excel Worksheet Functions 4 June 25th 09 03:19 AM
Finding Same Row Value JN[_6_] Excel Programming 4 May 26th 06 04:43 PM
finding the "end" Julia New Users to Excel 2 September 1st 05 02:38 AM
Finding Value Darryl Excel Worksheet Functions 1 April 13th 05 07:42 PM
finding a value tom[_6_] Excel Programming 1 August 11th 04 01:17 AM


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