+ Reply to Thread
Results 1 to 2 of 2

Widen drop down validation lists for multiple columns

  1. #1
    Registered User
    Join Date
    07-17-2012
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    20

    Widen drop down validation lists for multiple columns

    The contextures tutorial below shows how to temporarily modify the width of only one drop down list. I have 200 drop downs all in the same row. Is there a way to code it so that it works for all 200 drop downs?

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

  2. #2
    Registered User
    Join Date
    07-17-2012
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Widen drop down validation lists for multiple columns

    I found the solution to this issue and it was already on this forum. That solution can be found here: http://www.excelforum.com/excel-gene...ist-wider.html

    I did edit the code, however, because I only wanted the rows to widen when any cell was selected in a particular row, not any cell in an entire column. I also coded it so that the column width starts small and then expands when you make a selection. Below is the code that I used. Thank you to Dave Paterson!

    Option Explicit
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Dim myRng As Range

    Set myRng = Me.Range("D2:GU2")

    If Target.Count > 1 Then Exit Sub

    'reset all those column widths
    myRng.ColumnWidth = 5
    If Intersect(Target, myRng) Is Nothing Then
    'do nothing
    Else
    Target.EntireColumn.ColumnWidth = 12
    End If
    End Sub

+ 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