View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Sharad Naik Sharad Naik is offline
external usenet poster
 
Posts: 212
Default Trigger macro if an Activecell is within a specific Range

Why not code it in worksheet_change event?
It will be quite simple to do it there.
Try following code in Worksheet_Change macro for sheet5, which will
run Bonus if an integer is entered in range F19:F74

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 6 Then
If Target.Row 18 And Target.Row < 75 And IsNumeric(Target.Value) Then
If Target.Find(".", LookAt:=xlPart) Is Nothing Then
Bonus
End If
End If
End If
End Sub

Sharad

"helmekki" wrote in message
...

Hi there

I have an Auto open Macro that runs another macro called Bouns...
the auto open macro runs perfectely the Bouns code...

my problem is: I want the Bouns macro proceeds working if an integer
is entered into the range("F19:F74"), otherwise exit subs i.e. if an
integer is entered else where in the sheet then exit Bouns
sub................

I only know, if an integer is entered into a specific
column.........................


Formula:
--------------------
Sub Auto_Open()
Sheet5.OnEntry = "Bouns"
End Sub

Sub Bouns()
Dim myrange As Range
Set myrange = Range("F20:F74")

With ActiveCell
If .Column = 6 Then

my code

end with
End Sub
--------------------





--
helmekki


------------------------------------------------------------------------
helmekki's Profile:
http://www.excelforum.com/member.php...fo&userid=6939
View this thread: http://www.excelforum.com/showthread...hreadid=271778