Advertisement

Find maximum value from the selected ranges, using Excel VBA

Find maximum value from the selected ranges, using Excel VBA The video shows how we can find the maximum value from a single range or from multiple ranges, using Excel VBA.

Scenario 1: Selecting one range:
When selecting one range, it is very simple to find the maximum value by comparing all the values in the selected range. The range may have empty cells and cells having numeric / date type data. Date type data is also treated as numeric when we fetch the value of the cell. Every date is represented by a number.

Scenario 2: Selecting multiple ranges:
In case of multiple ranges (selected using Ctrl + Mouse, for example), only the first range is considered, if we don't use the 'Area' collection. The ranges may consist of numeric / date type data and empty cells as well. The maximum value is fetched considering only the first range (if 'Area' collection is not used). In each 'Area' (or range), we have rows and columns, which must be traversed for each 'Area'.

Watch the video for better understanding through code.

If you have any doubts or need video on some other topic, please let us know in comments.

Thanks!

excel,vba,excel vba,range,advanced excel,learn vba,learn excel vba,learn advanced excel,visual basic,visual basic for applications,learn advanced vba,vba programming,excel 2019,excel 2019 vba,excel vba 2019,

Post a Comment

0 Comments