dmpritch82
Aerospace
- Aug 26, 2005
- 9
im having trouble running this subroutine. When it is finished it will be a loop that will find the maximum value in one column and then tell me the corresponding values in the next column every ten rows for 45000 rows. Right now I am just trying to get it to work for the first ten rows.
Sub FindMax()
Dim myRangea As Range
Set myRangea = Worksheets("Sheet1").Range("A2:A10")
myMax = Application.WorksheetFunction.Max(myRangea)
Dim myRange2 As Range
Set myRange2 = Worksheets("Sheet1").Range("A2:B10")
myVar = Application.WorksheetFunction_.VLookup(myMax, myRange2, 2)
MsgBox myVar
End Sub
thanks,
michelle
Sub FindMax()
Dim myRangea As Range
Set myRangea = Worksheets("Sheet1").Range("A2:A10")
myMax = Application.WorksheetFunction.Max(myRangea)
Dim myRange2 As Range
Set myRange2 = Worksheets("Sheet1").Range("A2:B10")
myVar = Application.WorksheetFunction_.VLookup(myMax, myRange2, 2)
MsgBox myVar
End Sub
thanks,
michelle