Excel Find Largest and Smallest Value | VBA Macro #36

Macro Intro

This is an Excel macro that will find the Largest and Smallest values in a Workbook. By Default, this Excel macro will loop through the entire Active Workbook. Once this Excel macro finishes a Message Box will display the Active Workbook that was searched and the Max and Min values found. It is easy to customize the Excel Find Largest and Smallest Value macro to only search through a specific range of cells for these values. This macro can stand alone or be used as a function within existing macros. With some additional updates to the VBA code you can have this Excel macro fire every time an Excel Workbook opens! No longer do you need to sort or use conditional formatting to identify the Largest and Smallest values in Excel. There is a better way with VBA so start using the Excel Find Largest and Smallest Value today!

Use the following link to download the Excel Workbook seen in the videos below: Fruit Inventory Status

See it in Action

Watch this video to see this macro in action.

Code

Here is the code for this macro. Make sure the following References are setup before running it: Visual Basic For Applications, Microsoft Excel 16.0 Object Library

Customization

These segments of code can be customized to personalize this macro.

You can also call this Excel macro immediately when a Workbook opened by pasting this code into the ThisWorkbook portion of Visual Basic.[code lang=”vb”]Sub Workbook_Open() ‘Call MacroName Call FindLargestSmallestValue End Sub[/code]
Search

First time using VBA?

The Developer Tab is an additional section of the ribbon when activated allows you access to Visual Basic in Applications like Access, Excel, Outlook, PowerPoint, Word.
Setup Now
Once the Developer Tab is available you will have the capability to update your security to allow Macros to run in the current application.
Setup Now
A sub of code is a collection of objects and variables. For the code to successfully run a library of references needs to be set.
Setup Now
Subscribe as an Insider to receive additional rights.
If you like our content and want to show your support tip us here!

Contact Us

Looking to improve your computer processes?
Leverage & Lean is here to help!

Powered By MemberPress WooCommerce Plus Integration

Free Macro

Start creating Less Clicks, More Results today!