Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default Initiating a Macro

I would like to initiate a macro when a cell has a specific value or
satisfies a formula (e.g. AB). Is that possible? Thanks in advance. JS
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Initiating a Macro

Hi,

You could use the worksheet change event. Right click your sheet tab, view
code and paste this in

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Target.Address = "$A$1" Then
If IsNumeric(Target) Then
On Error Resume Next
Application.EnableEvents = False
If Target.Value Range("B1").Value Then
'do your thing
End If
Application.EnableEvents = True
On Error GoTo 0
End If
End If
End Sub

Now if A1 changes to a value greater than B1 you can run some code.

Mike


"Setts" wrote:

I would like to initiate a macro when a cell has a specific value or
satisfies a formula (e.g. AB). Is that possible? Thanks in advance. JS

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default Initiating a Macro

More detail. Any cell, specific cell, before/after

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Setts" wrote in message
...
I would like to initiate a macro when a cell has a specific value or
satisfies a formula (e.g. AB). Is that possible? Thanks in advance. JS


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
need help to update macro to office 2007 macro enabled workbook jatman Excel Discussion (Misc queries) 1 December 14th 07 01:57 PM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 3 February 5th 07 08:22 PM
Macro: automatically initiating upon cell click pmp613 Excel Discussion (Misc queries) 1 December 28th 06 09:46 AM
initiating a macro johnT Excel Worksheet Functions 9 April 2nd 05 03:43 PM


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

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

About Us

"It's about Microsoft Excel"