+ Reply to Thread
Results 1 to 7 of 7

How do I change the width of the data validation list box?

  1. #1
    Davy Lawson
    Guest

    How do I change the width of the data validation list box?

    I use data validation to select data entries. The width of the list box is
    different in some worksheets. How do I control the width to expand when there
    is longer text in the list range?

  2. #2
    Dave Peterson
    Guest

    Re: How do I change the width of the data validation list box?

    That box's width is determined by the width of the cell that has the
    Data|Validation.

    Can you widen the column?

    Can you (ugh) merge some cells?

    Davy Lawson wrote:
    >
    > I use data validation to select data entries. The width of the list box is
    > different in some worksheets. How do I control the width to expand when there
    > is longer text in the list range?


    --

    Dave Peterson

  3. #3
    Debra Dalgleish
    Guest

    Re: How do I change the width of the data validation list box?

    Or, if you can use programming, you could use a SelectionChange event to
    temporarily widen the column. There are some instructions here:

    http://www.contextures.com/xlDataVal08.html#Wider

    Dave Peterson wrote:
    > That box's width is determined by the width of the cell that has the
    > Data|Validation.
    >
    > Can you widen the column?
    >
    > Can you (ugh) merge some cells?
    >
    > Davy Lawson wrote:
    >
    >>I use data validation to select data entries. The width of the list box is
    >>different in some worksheets. How do I control the width to expand when there
    >>is longer text in the list range?

    >
    >



    --
    Debra Dalgleish
    Excel FAQ, Tips & Book List
    http://www.contextures.com/tiptech.html


  4. #4
    Registered User
    Join Date
    11-12-2013
    Location
    Minneapolis, MN
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: How do I change the width of the data validation list box?

    I went to the contextures link and used the code as it directed, however, I get an error message now.

    If I go any of the cells in that column, the VBA code page opens up and I get the following message:

    Compile Error:
    Ambigous name detected: Worksheet _SelectionChange

    and the following vb code is hightlighted:

    Private Sub Worksheet_SelectionChange(ByVal Target As Range


    The code I have used is:
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target.Count > 1 Then Exit Sub
    If Target.Column = 13 Then
    Target.Columns.ColumnWidth = 40
    Else
    Columns(13).ColumnWidth = 20
    End If
    End Sub


    Anyhelp would be appreciated.

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: How do I change the width of the data validation list box?

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  6. #6
    Registered User
    Join Date
    11-12-2013
    Location
    Minneapolis, MN
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: How do I change the width of the data validation list box?

    your box is full so my message to you will not go through.
    Where do you make a new post?

  7. #7
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: How do I change the width of the data validation list box?


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1