如何在vba中获取Max()的单元格地址

时间:2014-06-18 12:57:42

标签: excel vba max cell

嗨我有这样的东西,想要存储最大数字的单元格地址,在最大数字上减去“x”参数

星期日

3

10

2

0

9.93

EG。 x = 3,maxvalue = 10 --->新表maxvalue = 7

星期日

3

7

2

0

9.93

我正在使用Sub

1 个答案:

答案 0 :(得分:1)

考虑:

Sub WhereIsMax()
    Dim rLook As Range, Biggest As Variant, Where As String
    Set rLook = Range("A1:Z100")
    Biggest = Application.WorksheetFunction.Max(rLook)
    Where = rLook.Find(What:=Biggest, After:=rLook(1)).Address
    MsgBox Where
End Sub