Maximum of selection

R

Robin Clay

Greetings !

Having selected a block say 4 columns wide and 12 rows
long, I want to establish the maximum value of the
selected cells in a particular column.

I have tried
myMax = MAX( _
Selection.FirstCol & _
Selection.FirstRow & ":" & _
Selection.FirstCol & _
Selection.LastRow)
but it doesn't work.

I would be most grateful if SKS would please furnish me
with the right expression.

And also, how would that expression change to find the
maximum of say the third column ?
 
B

Bernie Deitrick

Robin,

myMax = Application.WorksheetFunction.Max(Selection.Columns(1))

For the third column of the selection:

myMax = Application.WorksheetFunction.Max(Selection.Columns(3))

HTH,
Bernie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top