Thread: Code location
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Curt Curt is offline
external usenet poster
 
Posts: 469
Default Code location

If I understand you correctly I should have the code in place of where I now
call it in this code. Am not quite sure how it would trigger in this way.
Private Sub Worksheet_Change(ByVal Target As range)
Dim rng As range
Dim hastext As Long
On Error GoTo errhandler
Application.EnableEvents = False
If Target.Column = 12 And Target.Value <= 10 And
IsNumeric(Target.Value) Then _
Call CopyMailE(Target)
If Target.Column = 12 And Target.Value 10 And IsNumeric(Target.Value)
Then _
Call CopyDonors(Target)
If Target.Column = 12 And Target.Value 10 And IsNumeric(Target.Value)
Then _
Call CopyMailD(Target)
errhandler:
Application.OnKey "{RETURN}", "checkUp"---------------
Application.OnKey "{DOWN}", "checkUp"------------------
Application.EnableEvents = True
End Sub
Have this code for "checkup"
Sub checkUp()
' checkUp Macro watches data entry on data sheet
Dim chkRow As Integer
Dim cel As Object
chkRow = ActiveCell.row
If chkRow = 1 Then
ActiveCell.Offset(2, 0).Activate
Exit Sub
End If
For Each cel In range(Cells(chkRow, 3), Cells(chkRow, 11))
If Trim(cel) = "" Then
msgbox "If Row Complete Click OK Move with Mouse "
cel.Activate
Exit Sub
End If
Next cel
ActiveCell.Offset(1, 0).Activate
End Sub




"Barb Reinhardt" wrote:

I think I'd put something like this in the Worksheet_Change event for the
worksheet in question.

http://www.mvps.org/dmcritchie/excel/event.htm
--
HTH,
Barb Reinhardt

If this post was helpful to you, please click YES below.



"Curt" wrote:

Want the module I have to be used only on the one worksheet. Where should
this module procedure be located. Presently it is in the list under modules
in the project.
It calls when return key is depressed. Looking it seems that it should be in
only the window opened when you ckeck the worksheet. Is this correct. Also
should the sub br called private? Or would it be private if within the sheet
code? I copy data from this sheet to others. that is when it activates on
other sheets.
Thanks