G
Guest
I have the following VBA code to get "max value" and "the column number"
where max value is. I can get the max value, but not the column number. Any
suggestions?
Thanks.
Sub model()
For i = 1 To 16
Set eachrow = Range("data").Rows(i)
maxvalue = Application.WorksheetFunction.Max(eachrow)
colnumber = maxvalue.Column
Cells(i, 10) = maxvalue
Cells(i, 11) = colnumber
Next
End Sub
where max value is. I can get the max value, but not the column number. Any
suggestions?
Thanks.
Sub model()
For i = 1 To 16
Set eachrow = Range("data").Rows(i)
maxvalue = Application.WorksheetFunction.Max(eachrow)
colnumber = maxvalue.Column
Cells(i, 10) = maxvalue
Cells(i, 11) = colnumber
Next
End Sub