Highlight Min Value in Selection Using Macros in Excel Office 365!!
Tags: highlightminvalueine, vbamacros
Published: 2021-02-15 10:21:31

---
title: Highlight Min Value in Selection Using Macros in Excel Office 365!!
published: true
date: 2021-02-15 10:19:19 UTC
tags: HighlightminvalueinE,VBAMacros
canonical_url: https://geekexcel.com/highlight-min-value-in-selection-using-macros-in-excel-office-365/
---

In this brief article, you will learn the simple steps to **highlight min value in the selection using Macros** in Excel Office 365. [VBA](https://geekexcel.com/excel-office-365-vba-overview-definition-and-examples/) & Macros plays a vital role in Excel. Because it is used for completing any kind of task with a few clicks. You just follow the steps given below to achieve the task.

## Highlight Min Value in Selection Using Macros:

Follow the below instructions to highlight the smallest value in the range in Excel.

- In the following image, you can see the set values in a range from **B1:B10**. We are going to find the smallest one from this input range.

![Example](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/02/EXCEL_VvW6xpLmtc.png)<figcaption id="caption-attachment-21907">Example</figcaption>

- On the **Developer Tab, select** the **Visual Basic** option under the **Code** section.

![Select Visual Basic option](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2020/09/Select-Visual-Basic-option-4.png)<figcaption id="caption-attachment-14755">Select the Visual Basic option</figcaption>

- Then you need to copy and paste the code given below.

VBA code to highlight min value using Macros

Sub HighlightMinValue()

Dim cell As Range

For Each cell In Selection

If cell = WorksheetFunction.Min(Selection) Then

cell.Style = “Note”

End If

Next cell

End Sub

- You need to **save the code** by selecting it. Then **close** the **window.**

![Save the code](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/02/EXCEL_o4sDDnhlQt.png)<figcaption id="caption-attachment-21908">Save the code</figcaption>

- You have to open the sheet containing the data. On the **Developer Tab, choose** the **Macros option** in the **Code** section.

![Choose the Macros option](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2020/09/Choose-the-Macros-option-2.png)<figcaption id="caption-attachment-14747">Choose the Macros option</figcaption>

- You need to make sure that your macro is selected and **click** the **Run** button.

![Click the Run button](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/02/EXCEL_GugDcHASIC.png)<figcaption id="caption-attachment-21909">Click the Run button</figcaption>

- At last, you will get the result as shown in the below screenshot.

![Output](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/02/EXCEL_rB25xwfHY7.png)<figcaption id="caption-attachment-21910">Output</figcaption>

## Sum-Up:

To be crisp, you can understand the simple steps to **highlight min value in the selection using Macros** in Excel Office 365. Drop your **feedback** in the below comment section. Thanks for visiting **[Geek Excel.](https://geekexcel.com/)** Keep Learning!

#### Also Read:

- [Convert Formulas into Values using Macros (VBA) in Excel 365!!](https://geekexcel.com/convert-formulas-into-values-using-macros-vba-in-excel-365/)
- [Remove Extra Spaces from Selection Using Macros (VBA) in Excel!!](https://geekexcel.com/remove-extra-spaces-from-selection-using-macros-vba-in-excel/)
- [Reverse Text Function using Macros (VBA) in Excel Office 365!!](https://geekexcel.com/reverse-text-function-using-macros-vba-in-excel-office-365/)
- [Insert a Linked Image using Macros (VBA) in Excel Office 365!!](https://geekexcel.com/insert-a-linked-image-using-macros-vba-in-excel-office-365/)