Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
stop application {on keys}
This code is in my data worksheet whenever any data is copied to other sheets
the on key apps. go with it. Can I stop the on key apps. from being active on sheets copied to? Ckeck up is a procedure that checks for row data completed. I thought that as a private sub it would only be active on this sheet Option Explicit Private Sub Worksheet_Change(ByVal Target As Range) Dim rng As Range On Error GoTo errhandler Application.EnableEvents = False If Target.Column = 12 And Target.Value (" ") Then _ Call Announcer(Target) If Target.Column = 8 And Target.Value 1 And IsNumeric(Target.Value) Then _ Call CopyMailE(Target) If Target.Column = 11 And Target.Value 10 And IsNumeric(Target.Value) Then _ Call CopyDonors(Target) If Target.Column = 11 And Target.Value 10 And IsNumeric(Target.Value) Then _ Call CopyMailD(Target) errhandler: Application.EnableEvents = True Application.OnKey "{RETURN}", "checkUp" Application.OnKey "{DOWN}", "checkUp" End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
stop application {on keys}
Hi Curt,
If I understand it correctly, you have the procedure on your data sheet and you don't want it to execute on copies of the data sheet.. Even if you declare the sub as private, when you make a copy, the copy will have it's own private copy of the procedure as well. Perhaps, if in your checkUp procedure, check the name of the datasheet.. For example, assuming the name of your datasheet is "Data": Private Sub checkUp 'if this sub is not on the original data sheet. don't do anything. If Me.Name < "Data" then Exit Sub '... the rest of your code here... End Sub If you use that approach, you might want to consider moving it to a module and just declare it as a public sub. Then check the name of the activesheet. Public Sub checkUp 'if this sub is not on the original data sheet. don't do anything. If ActiveSheet.Name < "Data" then Exit Sub '... the rest of your code here... End Sub -- Hope that helps. Vergel Adriano "Curt" wrote: This code is in my data worksheet whenever any data is copied to other sheets the on key apps. go with it. Can I stop the on key apps. from being active on sheets copied to? Ckeck up is a procedure that checks for row data completed. I thought that as a private sub it would only be active on this sheet Option Explicit Private Sub Worksheet_Change(ByVal Target As Range) Dim rng As Range On Error GoTo errhandler Application.EnableEvents = False If Target.Column = 12 And Target.Value (" ") Then _ Call Announcer(Target) If Target.Column = 8 And Target.Value 1 And IsNumeric(Target.Value) Then _ Call CopyMailE(Target) If Target.Column = 11 And Target.Value 10 And IsNumeric(Target.Value) Then _ Call CopyDonors(Target) If Target.Column = 11 And Target.Value 10 And IsNumeric(Target.Value) Then _ Call CopyMailD(Target) errhandler: Application.EnableEvents = True Application.OnKey "{RETURN}", "checkUp" Application.OnKey "{DOWN}", "checkUp" End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do i stop my arrow keys from scrolling? | Excel Discussion (Misc queries) | |||
Macro Shortcut Key Conflicts with Application Shortcut Keys | Excel Programming | |||
Macro Shortcut Key Conflicts with Application Shortcut Keys | Excel Programming | |||
Application.OnKey syntax for + and - keys | Excel Programming | |||
what is the keys to stop recording, i cant press it when making a. | Excel Discussion (Misc queries) |