how to use Data Validation Width is too Small in Microsoft Excel 2010?
Tags: datavalidationwidthi, vbamacros
Published: 2021-09-29 09:12:57

---
title: how to use Data Validation Width is too Small in Microsoft Excel 2010?
published: true
date: 2021-09-26 05:41:08 UTC
tags: DataValidationWidthI,VBAMacros
canonical_url: https://geekexcel.com/how-to-use-data-validation-width-is-too-small-in-microsoft-excel-2010/
---

In this tutorial, we will guide you on how to ** ** use **data validation width is too small** in Microsoft Excel 2010. Let’s get them below!! Get an official version of MS Excel from the following link: **[https://www.microsoft.com/en-in/microsoft-365/excel](https://www.microsoft.com/en-in/microsoft-365/excel)**

## Example

- Firstly, you need to  **create a sample data** contains **data validation cell**  in Microsoft Excel.

![](https://geekexcel.com/wp-content/uploads/2021/09/Sample-data-28.png)<figcaption>Sample data</figcaption>

- In the Excel Worksheet, you have to go to the  **Developer Tab.**
- Then, you need to ** ** select the  **Visual Basic**  option under the  **Code**  section.

![Select Visual Basic](https://geekexcel.com/wp-content/uploads/2021/09/Select-Visual-Basic-9-1024x180.png)<figcaption>Select Visual Basic</figcaption>

- Now, you have to  **copy and paste the code**  given below.

```
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
   If Target.Column = 1 Then
       Target.Columns.ColumnWidth = 30
   Else
       Columns(1).ColumnWidth = 5
End If
End Sub

```

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

![](https://geekexcel.com/wp-content/uploads/2021/09/Save-the-Code-60.png)<figcaption>Save the Code</figcaption>

- Again, you have to go to the  **Excel Spreadsheet** , and click on the  **Developer Tab**.
- You need to choose the  **Macros option**  in the Code section.

![Choose Macro option](https://geekexcel.com/wp-content/uploads/2021/09/Choose-Macro-option-11-1024x184.png)<figcaption>Choose Macro option</figcaption>

- Now, you have to make sure that your  **macro name is selected**  and click the  **Run ** button.
- Finally, you will receive the  **output ** in the  **Microsoft Excel**.

![](https://geekexcel.com/wp-content/uploads/2021/09/Output1-4.png)<figcaption>Output</figcaption>

## Conclusion

Here, we have explained the step-by-step procedure on how to ** ** use **data validation width is too small** in Microsoft Excel 2010. Make use of this. Please share your worthwhile  **feedback**  in the below  **comment**  section. To learn more, check out our website **[Geek Excel](https://geekexcel.com/)!!**

**Read Next:**

- **[Compare Two Ranges of Cells If they are Equal or Different in Excel 365!](https://geekexcel.com/compare-two-ranges-of-cells-if-they-are-equal-or-different-in-excel-365/)**
- **[Excel Formulas to Compare two Text Strings ~ Easy Tricks!!](https://geekexcel.com/excel-formulas-to-compare-two-text-strings/)**
- **[How to Compare Two Ranges using Macros (VBA) in Excel 365?](https://geekexcel.com/how-to-compare-two-ranges-using-macros-vba-in-excel-365/)**
- **[Compare Two Ranges to Select/Shade Duplicate or Unique Values in Excel 365!!](https://geekexcel.com/compare-two-ranges-to-select-shade-duplicate-or-unique-values-in-excel-365/)**
- **[Excel Formulas to Check Dates are Same Month and Year {Easy Tricks}](https://geekexcel.com/excel-formulas-to-check-dates-are-same-month-and-year-easy-tricks/)**