ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Data Validation - Temporarily Make dropdown list wider (https://www.excelbanter.com/excel-discussion-misc-queries/176661-data-validation-temporarily-make-dropdown-list-wider.html)

Alison

Data Validation - Temporarily Make dropdown list wider
 
http://www.contextures.on.ca/xlDataVal08.html#Wider

Hi I have used the above link and copied the code. It works correctly in the
first column (Column E). How do I modify the code to get this apply to all
columns (Columns E to AB)?
Thank you
Alison



Dave Peterson

Data Validation - Temporarily Make dropdown list wider
 
Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Count 1 Then Exit Sub

'reset everything
Me.Range("E:AB").EntireColumn.ColumnWidth = 5

If Intersect(Target, Me.Range("E:AB")) Is Nothing Then
'do nothing more
Else
'do the single column
Target.EntireColumn.ColumnWidth = 20
End If
End Sub


Alison wrote:

http://www.contextures.on.ca/xlDataVal08.html#Wider

Hi I have used the above link and copied the code. It works correctly in the
first column (Column E). How do I modify the code to get this apply to all
columns (Columns E to AB)?
Thank you
Alison


--

Dave Peterson


All times are GMT +1. The time now is 06:34 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com