MarvinP

Choose, I have to pick the item specifically...

I had tried, but the function below return Four... unless I have to put everything in order which in real life the values don't line up like that.

Any other way that you know?


Sub MaxVar()
    Dim One, Two, Three, Four, Five As Integer
    Dim MaxValue, MaxValueName As String
    One = 1
    Two = 2
    Three = 3
    Four = 4
    Five = 5
    MaxValue = WorksheetFunction.Max(Five, One, Two, Three, Four)
    MaxValueName = Choose(MaxValue, "Five", "One", "Two", "Three", "Four")
    MsgBox MaxValueName
End Sub