Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Macro Formula for Max value

Try:

Sub bee()
Dim r As Range
Set r = Range("A:A")
v = Application.Max(r)

For i = 1 To 8
If v = Cells(i, "A").Value Then
Cells(1, "D").Value = v
Cells(2, "D").Value = Cells(i, "C").Value
End If
Next
End Sub


It get the max value in column A, finds it, and copies the max value and
asociated date to the D column.
--
Gary's Student


"El Bee" wrote:

I'm working with a spreadsheet that tracks the daily orders. I need to find
the maximum orders for any given month and then associate the date that's in
another column. I then need to capture that date and the sales number and
paste them in two other cells.
I can't sort the daily totals so I can't use the vlookup function. It looks
like I can only write a macro and I'm not sure how to do that.

Sample of what I could be working with.

Column a Column b Column c
2,749 11/30/06
2,916 12/01/06
3,055 12/02/06
9,052 12/03/06
4,830 12/04/06
2,308 12/05/06
2,359 12/06/06
4,153 12/07/06

In this sample the number of sales would be 9,052 and the date would be
12/03/06

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
Find value in array Brook6 Excel Worksheet Functions 26 January 30th 07 09:40 PM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
Formula for current month minus one = Quarter number in a macro. Pank Excel Discussion (Misc queries) 11 June 22nd 05 02:47 PM
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 07:48 PM
Macro Formula revision? Mark Excel Worksheet Functions 1 November 28th 04 01:43 AM


All times are GMT +1. The time now is 02:49 PM.

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"