Data Validation Width is too Small in Microsoft Excel 2010

In this article, you will learn how to increase the size of the selected cell that contains data validation.

If you are working on a report that contains too much information & there is shortage of space, the cells that contain data validation with too much information will not be visible.

Question): Column A contains data validation & the problem I am facing is the width of the cell is only five and when I try to select the selection from the dropdown list, the whole content is not visible.

How can I view the entire information visible to the user when selecting the data validation cell?

Snapshot of data contains data validation cell wherein the content is too large. Refer below snapshot:

image 1

 

 

We need follow the below steps:

  • Click on Developer tab
  • From Code group, select Visual Basic

image 2

 

  • Enter the following code in the worksheet module

 

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

 

image 3

 

  • As we select any cell in column A that contains data validation, then width of the cell will be increased automatically. Refer below snapshot:

image 4

 

In this way, we can increase the width of the data validation of the cell upon selection using Macro.

image 5

 

 

 

Comments

  1. Stathis Karampoikis

    Is Working great, but i want to do it for more than one columns, i do have 6 actually is there any way to do it

Leave a Reply

Your email address will not be published. Required fields are marked *

Terms and Conditions of use

The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.