Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Trigger macro if an Activecell is within a specific Range


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 intege
is entered into the range("F19:F74"), otherwise exit subs i.e. if a
integer is entered else where in the sheet then exit Boun
sub................

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


PHP code
-------------------
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 Su
-------------------


:confused

--
helmekk

-----------------------------------------------------------------------
helmekki's Profile: http://www.excelforum.com/member.php...nfo&userid=693
View this thread: http://www.excelforum.com/showthread.php?threadid=27177

  #2   Report Post  
Posted to microsoft.public.excel.programming
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Trigger macro if an Activecell is within a specific Range

Sub Bouns()
Dim myrange As Range
Dim trigger as Range
set trigger = Application.Caller
Set myrange = Range("F20:F74")

if trigger.count 1 then exit sub
if intersect(trigger,myrange) is nothing then exit sub
if not isnumeric(trigger) then exit sub
if isempty(trigger) then exit sub
my code

end with
End Sub

--
Regards,
Tom Ogilvy


"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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro - specific range puiuluipui Excel Discussion (Misc queries) 3 May 10th 09 11:33 AM
ActiveCell in a Range? Filo Excel Discussion (Misc queries) 3 May 22nd 07 09:52 PM
Need help - Macro to copy a specific range Dileep Chandran Excel Worksheet Functions 9 December 5th 06 09:10 AM
Need help - Macro to copy a specific range Dileep Chandran Excel Worksheet Functions 0 December 4th 06 10:24 AM
macro that sumif a specific range jane Excel Programming 1 January 21st 04 11:20 PM


All times are GMT +1. The time now is 03:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"