Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I need 14 columns to temporarily expand so a data validation window can be
read. Can the following solution from http://www.contextures.on.ca/xlDataVal08.html#Wider be used on multiple columns? Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Count 1 Then Exit Sub If Target.Column = 37 Then Target.Columns.ColumnWidth = 10 Else Columns(37).ColumnWidth = 5 End If End Sub -- Thanks Jim C |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Maybe something like:
Option Explicit Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim myRng As Range If Target.Count 1 Then Exit Sub 'adjust the range to what you want Set myRng = Me.Range("a:b,x:y,d1:d5") 'fix all the columns myRng.EntireColumn.ColumnWidth = 5 If Intersect(Target, myRng) Is Nothing Then 'do nothing Else 'adjust that single column Target.EntireColumn.ColumnWidth = 10 End If End Sub Jim C wrote: I need 14 columns to temporarily expand so a data validation window can be read. Can the following solution from http://www.contextures.on.ca/xlDataVal08.html#Wider be used on multiple columns? Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Count 1 Then Exit Sub If Target.Column = 37 Then Target.Columns.ColumnWidth = 10 Else Columns(37).ColumnWidth = 5 End If End Sub -- Thanks Jim C -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
It worked great! Is there any way to eliminate the "blinking" in the
worksheet as the cursor moves to another cell? -- Jim C "Dave Peterson" wrote: Maybe something like: Option Explicit Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim myRng As Range If Target.Count 1 Then Exit Sub 'adjust the range to what you want Set myRng = Me.Range("a:b,x:y,d1:d5") 'fix all the columns myRng.EntireColumn.ColumnWidth = 5 If Intersect(Target, myRng) Is Nothing Then 'do nothing Else 'adjust that single column Target.EntireColumn.ColumnWidth = 10 End If End Sub Jim C wrote: I need 14 columns to temporarily expand so a data validation window can be read. Can the following solution from http://www.contextures.on.ca/xlDataVal08.html#Wider be used on multiple columns? Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Count 1 Then Exit Sub If Target.Column = 37 Then Target.Columns.ColumnWidth = 10 Else Columns(37).ColumnWidth = 5 End If End Sub -- Thanks Jim C -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim myRng As Range If Target.Count 1 Then Exit Sub 'adjust the range to what you want Set myRng = Me.Range("a:b,x:y,d1:d5") application.screenupdating = false '<-- added 'fix all the columns myRng.EntireColumn.ColumnWidth = 5 If Intersect(Target, myRng) Is Nothing Then 'do nothing Else 'adjust that single column Target.EntireColumn.ColumnWidth = 10 End If application.screenupdating = True '<-- added End Sub Jim C wrote: It worked great! Is there any way to eliminate the "blinking" in the worksheet as the cursor moves to another cell? -- Jim C "Dave Peterson" wrote: Maybe something like: Option Explicit Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim myRng As Range If Target.Count 1 Then Exit Sub 'adjust the range to what you want Set myRng = Me.Range("a:b,x:y,d1:d5") 'fix all the columns myRng.EntireColumn.ColumnWidth = 5 If Intersect(Target, myRng) Is Nothing Then 'do nothing Else 'adjust that single column Target.EntireColumn.ColumnWidth = 10 End If End Sub Jim C wrote: I need 14 columns to temporarily expand so a data validation window can be read. Can the following solution from http://www.contextures.on.ca/xlDataVal08.html#Wider be used on multiple columns? Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Count 1 Then Exit Sub If Target.Column = 37 Then Target.Columns.ColumnWidth = 10 Else Columns(37).ColumnWidth = 5 End If End Sub -- Thanks Jim C -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Data Validation & multiple columns | Excel Discussion (Misc queries) | |||
Making data validation drop down list wider | Excel Discussion (Misc queries) | |||
how do i use spreadsheets wider than 256 columns? | Excel Worksheet Functions | |||
Data validation for Multiple columns | Excel Discussion (Misc queries) | |||
Data Validation Window? | Excel Discussion (Misc queries) |