View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Patrick C. Simonds Patrick C. Simonds is offline
external usenet poster
 
Posts: 343
Default Prevent UserForm from displaying

The code below causes UserForm2 to display when I select a cell within the
range. Is there any way in the datesort module to prevent UserForm2 from
displaying?



Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)

If Not Application.Intersect(Target, Range("C5:V700")) Is Nothing Then
UserForm2.Show

End Sub

-----------------------------


Sub datesort()
'
' datesort Macro
' Macro recorded 3/23/2004 by mary
'

'
Module10.UnProtectSheet

Rows("7:1000").Select
Selection.Sort Key1:=Range("F7"), Order1:=xlAscending, Header:=xlGuess,
_
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortTextAsNumbers
Range("G7").Select

Module10.ProtectSheet

End Sub