Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code location
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code location
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Code for a button to change cell location | Excel Discussion (Misc queries) | |||
Code for Select a file and save it in a different location | Excel Programming | |||
VB Code Location; sheet, workbook, module | Excel Programming | |||
Need help with code location PL EASE | Excel Programming | |||
File Location code | Excel Programming |