LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default simple code problem

I have imported some code to enlarge the window while
picking data valadation lists from the Contextures website

When i put these on the same sheet code module
I get an compile error mesaage
It won't let me use Worksheet_SelectionChange twice on
the same sheet module

what is the best solution to this?

Is it alright just to insert the second line of code
after the first without the Private Sub
Worksheet...sentence.

Thanks in advance for any help

Private Sub Worksheet_SelectionChange(ByVal Target As
Range)
If Target.Address = "$A$2" Then
ActiveWindow.Zoom = 120
Else
ActiveWindow.Zoom = 100
End If
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As
Range)
Dim rngDV As Range
Application.EnableEvents = False
On Error Resume Next
Set rngDV = Cells.SpecialCells(xlCellTypeAllValidation)
On Error GoTo 0
If rngDV Is Nothing Then Exit Sub
If Intersect(Target, rngDV) Is Nothing Then
ActiveWindow.Zoom = 100
Else
ActiveWindow.Zoom = 120
End If
Application.EnableEvents = True
End Sub


 
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
Simple problem, simple formula, no FUNCTION ! Ron@Buy Excel Worksheet Functions 6 September 28th 07 04:51 PM
Help with some simple code Angeline Excel Discussion (Misc queries) 4 October 12th 06 09:06 AM
simple code gavmer[_5_] Excel Programming 4 May 19th 04 03:32 AM
Help With Very Simple Code pauluk[_17_] Excel Programming 7 April 8th 04 10:45 AM
Simple For Each Next code Marek S. Excel Programming 0 July 28th 03 12:34 PM


All times are GMT +1. The time now is 11:40 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"