Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Data validation: wider window on 14 columns

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Data validation: wider window on 14 columns

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Data validation: wider window on 14 columns

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Data validation: wider window on 14 columns

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Validation & multiple columns Bob Excel Discussion (Misc queries) 1 April 9th 07 10:24 AM
Making data validation drop down list wider Steve E Excel Discussion (Misc queries) 5 August 15th 06 05:15 PM
how do i use spreadsheets wider than 256 columns? Fredo Excel Worksheet Functions 2 July 19th 05 09:45 PM
Data validation for Multiple columns NC Excel Discussion (Misc queries) 2 May 11th 05 01:51 PM
Data Validation Window? Ken Excel Discussion (Misc queries) 1 January 11th 05 10:48 PM


All times are GMT +1. The time now is 07:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"