PC Review


Reply
Thread Tools Rate Thread

Code location

 
 
Curt
Guest
Posts: n/a
 
      29th Oct 2008
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
 
Reply With Quote
 
 
 
 
Barb Reinhardt
Guest
Posts: n/a
 
      29th Oct 2008
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

 
Reply With Quote
 
Curt
Guest
Posts: n/a
 
      29th Oct 2008
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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
code for Location p-rat Microsoft Access Form Coding 2 12th Jan 2008 12:54 AM
Need help with code location PL EASE PCOR Microsoft Excel Programming 3 18th Feb 2005 08:15 AM
using back-end location in VBA code =?Utf-8?B?QWxpY2UgRGF3c29u?= Microsoft Access Getting Started 4 15th Oct 2004 12:01 AM
Code location Robert Scheer Microsoft ASP .NET 2 10th Jul 2004 12:15 AM
W2K code location Tester Microsoft Windows 2000 0 15th Jul 2003 07:28 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:06 PM.