ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Maximum of selection (https://www.excelbanter.com/excel-programming/279143-maximum-selection.html)

Robin Clay[_2_]

Maximum of selection
 
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 ?


Bernie Deitrick[_2_]

Maximum of selection
 
Robin,

myMax = Application.WorksheetFunction.Max(Selection.Column s(1))

For the third column of the selection:

myMax = Application.WorksheetFunction.Max(Selection.Column s(3))

HTH,
Bernie


"Robin Clay" wrote in message
...
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 ?





All times are GMT +1. The time now is 10:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com