+ Reply to Thread
Results 1 to 3 of 3

Change dropdownlist width temporarily

Hybrid View

  1. #1
    Registered User
    Join Date
    05-26-2020
    Location
    Peru
    MS-Off Ver
    2013
    Posts
    1

    Change dropdownlist width temporarily

    Hi everyone

    I want to make the Dropdown List temporarily wider but not the column width

    I have tried with this code but it change column width temporarily too
     If Target.Address = "$A$2" Then
        ActiveWindow.Zoom = 120
      Else
        ActiveWindow.Zoom = 100
      End If
    I attached a sample workbook with dropdown list. Hope someone could help me, thanks.
    Attached Files Attached Files
    Last edited by alansidman; 05-26-2020 at 11:34 PM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,705

    Re: Change dropdownlist width temporarily

    Code Tags Added
    Your post does not comply with Rule 2 of our Forum RULES. Use code tags around code.

    Posting code between [CODE] [/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,692

    Re: Change dropdownlist width temporarily

    Re: "but not the column width"
    Why not?
    Otherwise, from what I understand, you'll be out of luck.

    From:
    https://www.contextures.com/xlDataVal08.html#wider

    Make the Dropdown List Temporarily Wider
    The Data Validation dropdown is the width of the cell that it's in, to a minimum of about 3/4".
    You could use a SelectionChange event to temporarily widen the column when it's active, then make it narrower when you select a cell in another column.
    For example, with Data Validation cells in column A:
    Private Sub Worksheet_SelectionChange(ByVal Target As Range) 
      If Target.Count > 1 Then Exit Sub
       If Target.Column = 1 Then
           Target.Columns.ColumnWidth = 20
       Else
           Columns(1).ColumnWidth = 5
       End If 
    End Sub
    Last edited by jolivanes; 05-26-2020 at 11:58 PM. Reason: Added info

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Temporarily change strings
    By Un-Do Re-Do in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-17-2017, 10:34 PM
  2. [SOLVED] Change currency when selected in dropdownlist (conditional formatting) and more
    By The excel apprentice in forum Excel Formulas & Functions
    Replies: 54
    Last Post: 04-11-2016, 05:23 AM
  3. [SOLVED] Code to temporarily allow column width adjustment when specific row is active
    By vamedic11 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-03-2015, 05:01 PM
  4. change color of shape based on value in dropdownlist
    By raketman007 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-07-2013, 09:39 AM
  5. [SOLVED] Change Pivot table data from dropdownlist
    By dare2join in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-05-2012, 05:17 AM
  6. Replies: 1
    Last Post: 11-29-2012, 09:58 AM
  7. Temporarily change:I there a way to not print a cell(s)?
    By Anne Troy in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 04:05 AM

Tags for this Thread

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