Code location

  • Thread starter Thread starter Curt
  • Start date Start date
C

Curt

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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top